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:
parent
f20d3e72b9
commit
757461d58b
140 changed files with 1805 additions and 2872 deletions
|
@ -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>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue