diff --git a/src/components/ItemTable/ReactTable.js b/src/components/ItemTable/ReactTable.js deleted file mode 100644 index 8cb5875..0000000 --- a/src/components/ItemTable/ReactTable.js +++ /dev/null @@ -1,80 +0,0 @@ -import { Table, TableBody, TableCell, TableHead, TableRow, TableContainer, Paper, TextField } from "@material-ui/core"; -import React from "react"; -import { useTable, useFilters, filterTypes, } from "react-table"; - -export default function ReactTable({ columns, data }) { - // Use the useTable Hook to send the columns and data to build the table - function DefaultColumnFilter({ - column - }) { - - return ( - { - column.setFilter(e.target.value || undefined) - }} - label={column.Header} - /> - ) - - - } - - const defaultColumn = React.useMemo( - () => ({ - Filter: DefaultColumnFilter, - }), - [] - ); - const { - getTableProps, // table props from react-table - getTableBodyProps, // table body props from react-table - headerGroups, // headerGroups, if your table has groupings - rows, // rows for the table based on the data passed - prepareRow // Prepare the row (this function needs to be called for each row before getting the row props) - } = useTable({ - columns, - data, - defaultColumn, - filterTypes, - }, - useFilters); - - - - - - return ( - - - - - {headerGroups.map(headerGroup => ( - - {headerGroup.headers.map(column => ( - {column.render("Header")} - -
{column.canFilter ? column.render('Filter') : null}
{/* This div renders the Filters based on if the table is set to allow filtering.*/} -
- ))} -
- ))} - - -
- - {rows.map((row, i) => { - prepareRow(row); - return ( - - {row.cells.map(cell => { - return {cell.render("Cell")}; - })} - - ); - })} - -
-
- - ); -} \ No newline at end of file