You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- /*
- * @Author: 赵伟
- * @Date: 2025-03-20 14:33:01
- * @Description: 通用的 Table 状态单元格
- */
-
- export type StatusInfo = {
- value: number | string;
- label: string;
- color?: string;
- };
-
- function statusTableCell(infos: StatusInfo[]) {
- return function (status?: string | number | null) {
- const info = infos.find((item) => item.value === status);
- if (status === null || status === undefined || !info) {
- return <span>--</span>;
- }
- return <span style={{ color: info.color }}>{info.label}</span>;
- };
- }
-
- export default statusTableCell;
|