diff --git a/src/components/enhanced-table/filter-row/FilterRow.jsx b/src/components/enhanced-table/filter-row/FilterRow.jsx deleted file mode 100644 index 1ebc3eafd..000000000 --- a/src/components/enhanced-table/filter-row/FilterRow.jsx +++ /dev/null @@ -1,32 +0,0 @@ -import TableRow from '@mui/material/TableRow' -import TableCell from '@mui/material/TableCell' - -import FilterCell from '~/components/enhanced-table/filter-row/filter-cell/FilterCell' - -const FilterRow = ({ columns, filter = {}, isSelection }) => { - const { filters, setFilterByKey, clearFilterByKey } = filter - - const filterCells = - filters && - columns.map((column) => ( - - )) - - const emptyCell = isSelection && filters && - - return ( - - {emptyCell} - {filterCells} - {emptyCell} - - ) -} - -export default FilterRow diff --git a/src/components/enhanced-table/filter-row/FilterRow.tsx b/src/components/enhanced-table/filter-row/FilterRow.tsx new file mode 100644 index 000000000..5c640fa07 --- /dev/null +++ b/src/components/enhanced-table/filter-row/FilterRow.tsx @@ -0,0 +1,44 @@ +import TableRow from '@mui/material/TableRow' +import TableCell from '@mui/material/TableCell' + +import FilterCell from '~/components/enhanced-table/filter-row/filter-cell/FilterCell' +import { TableColumn, TableFilter } from '~/types' + +interface FilterRowProps { + columns: TableColumn[] + filter?: TableFilter + isSelection?: boolean +} +const FilterRow = ({ + columns, + filter, + isSelection +}: FilterRowProps) => { + const filters = filter?.filters + const setFilterByKey = filter?.setFilterByKey + const clearFilterByKey = filter?.clearFilterByKey + + const filterCells = + filters && + columns.map((column) => ( + + )) + + const emptyCell = isSelection && filters && + + return ( + + {emptyCell} + {filterCells} + {emptyCell} + + ) +} + +export default FilterRow