import { useMaterialReactTable } from '../hooks/useMaterialReactTable'; import { type MRT_RowData, type MRT_TableInstance, type MRT_TableOptions, type Xor, } from '../types'; import { MRT_TablePaper } from './table/MRT_TablePaper'; type TableInstanceProp = { table: MRT_TableInstance; }; export type MaterialReactTableProps = Xor< TableInstanceProp, MRT_TableOptions >; const isTableInstanceProp = ( props: MaterialReactTableProps, ): props is TableInstanceProp => (props as TableInstanceProp).table !== undefined; export const MaterialReactTable = ( props: MaterialReactTableProps, ) => { let table: MRT_TableInstance; if (isTableInstanceProp(props)) { table = props.table; } else { table = useMaterialReactTable(props); } return ; };