mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29: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,4 +1,4 @@
|
|||
import { Row } from 'react-table';
|
||||
import { Row } from '@tanstack/react-table';
|
||||
import { ReactNode } from 'react';
|
||||
|
||||
import { ExpandableDatatableTableRow } from './ExpandableDatatableRow';
|
||||
|
@ -7,25 +7,25 @@ import { Datatable, Props as DatatableProps } from './Datatable';
|
|||
interface Props<D extends Record<string, unknown>>
|
||||
extends Omit<DatatableProps<D>, 'renderRow' | 'expandable'> {
|
||||
renderSubRow(row: Row<D>): ReactNode;
|
||||
expandOnRowClick?: boolean;
|
||||
}
|
||||
|
||||
export function ExpandableDatatable<D extends Record<string, unknown>>({
|
||||
renderSubRow,
|
||||
getRowCanExpand = () => true,
|
||||
expandOnRowClick,
|
||||
...props
|
||||
}: Props<D>) {
|
||||
return (
|
||||
<Datatable<D>
|
||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||
{...props}
|
||||
expandable
|
||||
renderRow={(row, { key, className, role, style }) => (
|
||||
getRowCanExpand={getRowCanExpand}
|
||||
renderRow={(row) => (
|
||||
<ExpandableDatatableTableRow<D>
|
||||
key={key}
|
||||
row={row}
|
||||
className={className}
|
||||
role={role}
|
||||
style={style}
|
||||
renderSubRow={renderSubRow}
|
||||
expandOnClick={expandOnRowClick}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue