import { Row } from 'react-table'; import { ReactNode } from 'react'; import { ExpandableDatatableTableRow } from './ExpandableDatatableRow'; import { Datatable, Props as DatatableProps } from './Datatable'; interface Props> extends Omit, 'renderRow' | 'expandable'> { renderSubRow(row: Row): ReactNode; } export function ExpandableDatatable>({ renderSubRow, ...props }: Props) { return ( // eslint-disable-next-line react/jsx-props-no-spreading {...props} expandable renderRow={(row, { key, className, role, style }) => ( key={key} row={row} className={className} role={role} style={style} renderSubRow={renderSubRow} /> )} /> ); }