From a98c14eb786ab3d6b530396d529061e32b85453e Mon Sep 17 00:00:00 2001 From: ArtemHolikov Date: Sun, 17 Nov 2024 18:35:48 +0200 Subject: [PATCH] rewrote to tsx --- .../{FilterCell.jsx => FilterCell.tsx} | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) rename src/components/enhanced-table/filter-row/filter-cell/{FilterCell.jsx => FilterCell.tsx} (54%) diff --git a/src/components/enhanced-table/filter-row/filter-cell/FilterCell.jsx b/src/components/enhanced-table/filter-row/filter-cell/FilterCell.tsx similarity index 54% rename from src/components/enhanced-table/filter-row/filter-cell/FilterCell.jsx rename to src/components/enhanced-table/filter-row/filter-cell/FilterCell.tsx index 8ffbe7e83..a8233f08c 100644 --- a/src/components/enhanced-table/filter-row/filter-cell/FilterCell.jsx +++ b/src/components/enhanced-table/filter-row/filter-cell/FilterCell.tsx @@ -3,8 +3,30 @@ import TableCell from '@mui/material/TableCell' import SearchInput from '~/components/search-input/SearchInput' import DateFilter from '~/components/enhanced-table/date-filter/DateFilter' import EnumFilter from '~/components/enhanced-table/enum-filter/EnumFilter' +import { TableColumn } from '~/types' -const FilterCell = ({ column, filter, setFilter, clearFilter }) => { +interface TableColumnProps extends TableColumn { + dataType: 'string' +} + +interface Filter { + from: string | null + to: string | null +} + +interface FilterCellProps { + column: TableColumnProps + filter?: F + setFilter: (filter: F) => void + clearFilter: () => void +} + +const FilterCell = ({ + column, + filter, + setFilter, + clearFilter +}: FilterCellProps) => { const enums = ( { const string = ( >} /> ) const date = ( void} /> )