mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
add initial table columns
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import {
|
||||
ItemTableListInnerColumn,
|
||||
TableColumnContainer,
|
||||
} from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
||||
import { Rating } from '/@/shared/components/rating/rating';
|
||||
|
||||
export const RatingColumn = (props: ItemTableListInnerColumn) => {
|
||||
const row: null | number | undefined = (props.data as (any | undefined)[])[props.rowIndex]?.[
|
||||
props.columns[props.columnIndex].id
|
||||
];
|
||||
|
||||
if (typeof row === 'number' || row === null) {
|
||||
return (
|
||||
<TableColumnContainer {...props}>
|
||||
<Rating readOnly value={row || 0} />
|
||||
</TableColumnContainer>
|
||||
);
|
||||
}
|
||||
|
||||
return <TableColumnContainer {...props}> </TableColumnContainer>;
|
||||
};
|
||||
Reference in New Issue
Block a user