implementation of datatable
This commit is contained in:
19
src/core/components/DataTable/index.js
Normal file
19
src/core/components/DataTable/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import { useMaterialReactTable } from "material-react-table";
|
||||
import DataTable_Paper from "./table/Paper";
|
||||
|
||||
const isTableInstanceProp = (props) => props.table !== undefined;
|
||||
|
||||
const DataTable = (props) => {
|
||||
let table;
|
||||
|
||||
if (isTableInstanceProp(props)) {
|
||||
table = props.table;
|
||||
} else {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
table = useMaterialReactTable(props);
|
||||
}
|
||||
|
||||
return <DataTable_Paper table={table} />;
|
||||
};
|
||||
|
||||
export default DataTable;
|
||||
Reference in New Issue
Block a user