1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-21 22:39:41 +02:00

chore(deps): upgrade react-table to v8 [EE-4837] (#8245)

This commit is contained in:
Chaim Lev-Ari 2023-05-02 13:42:16 +07:00 committed by GitHub
parent f20d3e72b9
commit 757461d58b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
140 changed files with 1805 additions and 2872 deletions

View file

@ -1,12 +1,11 @@
import { PropsWithChildren } from 'react';
import { Row, TableRowProps } from 'react-table';
import { Fragment, PropsWithChildren } from 'react';
import { Row } from '@tanstack/react-table';
interface Props<T extends Record<string, unknown> = Record<string, unknown>> {
isLoading?: boolean;
rows: Row<T>[];
emptyContent?: string;
prepareRow(row: Row<T>): void;
renderRow(row: Row<T>, rowProps: TableRowProps): React.ReactNode;
renderRow(row: Row<T>): React.ReactNode;
}
export function TableContent<
@ -15,7 +14,6 @@ export function TableContent<
isLoading = false,
rows,
emptyContent = 'No items available',
prepareRow,
renderRow,
}: Props<T>) {
if (isLoading) {
@ -28,11 +26,9 @@ export function TableContent<
return (
<>
{rows.map((row) => {
prepareRow(row);
const { key, className, role, style } = row.getRowProps();
return renderRow(row, { key, className, role, style });
})}
{rows.map((row) => (
<Fragment key={row.id}>{renderRow(row)}</Fragment>
))}
</>
);
}