mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-27 13:48:51 +01:00
refactor(DataTable): optimize processed data handling and improve warning for missing IDs; streamline DataTableComponents imports
This commit is contained in:
parent
1fa6d3db27
commit
b4aa36b6f1
2 changed files with 37 additions and 32 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue