refactor(DataTable): optimize processed data handling and improve warning for missing IDs; streamline DataTableComponents imports

This commit is contained in:
Marco Beretta 2025-09-26 18:51:45 +02:00
parent 1fa6d3db27
commit b4aa36b6f1
No known key found for this signature in database
GPG key ID: D918033D8E74CC11
2 changed files with 37 additions and 32 deletions

View file

@ -1,7 +1,7 @@
import { memo } from 'react';
import { flexRender } from '@tanstack/react-table';
import type { Row, ColumnDef } from '@tanstack/react-table';
import type { TableColumn } from './DataTable.types';
import type { Row } from '@tanstack/react-table';
import { TableCell, TableRow } from '../Table';
import { Checkbox } from '../Checkbox';
import { Skeleton } from '../Skeleton';
@ -45,8 +45,6 @@ const TableRowComponent = <TData extends Record<string, unknown>>({
virtualIndex,
}: {
row: Row<TData>;
columns: ColumnDef<TData, unknown>[];
index: number;
virtualIndex?: number;
}) => (
<TableRow
@ -80,8 +78,7 @@ export const MemoizedTableRow = memo(
TableRowComponent,
(prev, next) =>
prev.row.original === next.row.original &&
prev.row.getIsSelected() === next.row.getIsSelected() &&
prev.columns === next.columns,
prev.row.getIsSelected() === next.row.getIsSelected(),
);
export const SkeletonRows = memo(