mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-17 14:10:14 +02:00
a50984d2cb
- causes issues with drag/drop state
22 lines
716 B
TypeScript
22 lines
716 B
TypeScript
import {
|
|
ColumnNullFallback,
|
|
ColumnSkeletonFixed,
|
|
ItemTableListInnerColumn,
|
|
TableColumnTextContainer,
|
|
} from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
|
|
|
|
export const DefaultColumn = (props: ItemTableListInnerColumn) => {
|
|
const rowItem = props.getRowItem?.(props.rowIndex) ?? (props.data as any[])[props.rowIndex];
|
|
const row: any | undefined = (rowItem as any)?.[props.columns[props.columnIndex].id];
|
|
|
|
if (typeof row === 'string') {
|
|
return <TableColumnTextContainer {...props}>{row}</TableColumnTextContainer>;
|
|
}
|
|
|
|
if (row === null) {
|
|
return <ColumnNullFallback {...props} />;
|
|
}
|
|
|
|
return <ColumnSkeletonFixed {...props} />;
|
|
};
|