import { useMantineReactTable } from './useMantineReactTable'; import { MRT_TablePaper } from './table/MRT_TablePaper'; import { type MRT_TableOptions, type MRT_TableInstance, type Xor, } from './types'; 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 MantineReactTable = = {}>( props: Props, ) => { let table: MRT_TableInstance; if (isTableInstanceProp(props)) { table = props.table; } else { table = useMantineReactTable(props); } return ; };