import { MantineReactTable, MRT_RowData, MRT_TableInstance, MRT_TableOptions, useMantineReactTable, Xor } from "mantine-react-table"; import { useNejReactTable } from "./useNejReactTable"; type TableInstanceProp = { table: MRT_TableInstance; }; type Props = Xor< TableInstanceProp, MRT_TableOptions >; const isTableInstanceProp = ( props: Props, ): props is TableInstanceProp => (props as TableInstanceProp).table !== undefined; export const NejReactTable = ( props: Props, ) => { let table: MRT_TableInstance; if (isTableInstanceProp(props)) { table = props.table; } else { table = useNejReactTable(props); } return ; };