mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
refactor(groups): migrate groups selectors to react [EE-3842] (#8936)
This commit is contained in:
parent
2018529add
commit
e91b4f5c83
38 changed files with 543 additions and 627 deletions
|
@ -1,8 +1,11 @@
|
|||
import { Row, Table as TableInstance } from '@tanstack/react-table';
|
||||
|
||||
import { AutomationTestingProps } from '@/types';
|
||||
|
||||
import { Table } from './Table';
|
||||
|
||||
interface Props<D extends Record<string, unknown>> {
|
||||
interface Props<D extends Record<string, unknown>>
|
||||
extends AutomationTestingProps {
|
||||
tableInstance: TableInstance<D>;
|
||||
renderRow(row: Row<D>): React.ReactNode;
|
||||
onSortChange?(colId: string, desc: boolean): void;
|
||||
|
@ -16,12 +19,13 @@ export function DatatableContent<D extends Record<string, unknown>>({
|
|||
onSortChange,
|
||||
isLoading,
|
||||
emptyContentLabel,
|
||||
'data-cy': dataCy,
|
||||
}: Props<D>) {
|
||||
const headerGroups = tableInstance.getHeaderGroups();
|
||||
const pageRowModel = tableInstance.getPaginationRowModel();
|
||||
|
||||
return (
|
||||
<Table>
|
||||
<Table data-cy={dataCy}>
|
||||
<thead>
|
||||
{headerGroups.map((headerGroup) => (
|
||||
<Table.HeaderRow<D>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue