Files
feishin/src/renderer/components/item-list/item-table-list/columns/path-column.tsx
T
jeffvli a50984d2cb remove memoization from individual table columns
- causes issues with drag/drop state
2026-01-23 20:43:28 -08:00

26 lines
796 B
TypeScript

import {
ColumnNullFallback,
ColumnSkeletonVariable,
ItemTableListInnerColumn,
TableColumnTextContainer,
} from '/@/renderer/components/item-list/item-table-list/item-table-list-column';
export const PathColumn = (props: ItemTableListInnerColumn) => {
const rowItem = props.getRowItem?.(props.rowIndex) ?? (props.data as any[])[props.rowIndex];
const row: string | undefined = (rowItem as any)?.[props.columns[props.columnIndex].id];
if (typeof row === 'string' && row) {
return (
<TableColumnTextContainer {...props}>
<span>{row}</span>
</TableColumnTextContainer>
);
}
if (row === null) {
return <ColumnNullFallback {...props} />;
}
return <ColumnSkeletonVariable {...props} />;
};