diff --git a/app/react/components/datatables/ExpandableDatatable.tsx b/app/react/components/datatables/ExpandableDatatable.tsx index 56ab2e394..5ada05fff 100644 --- a/app/react/components/datatables/ExpandableDatatable.tsx +++ b/app/react/components/datatables/ExpandableDatatable.tsx @@ -1,4 +1,4 @@ -import { Row } from '@tanstack/react-table'; +import { Row, TableMeta } from '@tanstack/react-table'; import { ReactNode } from 'react'; import { ExpandableDatatableTableRow } from './ExpandableDatatableRow'; @@ -9,20 +9,25 @@ import { } from './Datatable'; import { DefaultType } from './types'; -interface Props - extends Omit, 'renderRow' | 'expandable'> { +interface Props< + D extends DefaultType, + TMeta extends TableMeta = TableMeta +> extends Omit, 'renderRow' | 'expandable'> { renderSubRow(row: Row): ReactNode; expandOnRowClick?: boolean; } -export function ExpandableDatatable({ +export function ExpandableDatatable< + D extends DefaultType, + TMeta extends TableMeta = TableMeta +>({ renderSubRow, getRowCanExpand = () => true, expandOnRowClick, ...props -}: Props & PaginationProps) { +}: Props & PaginationProps) { return ( - + // eslint-disable-next-line react/jsx-props-no-spreading {...props} getRowCanExpand={getRowCanExpand}