diff --git a/src/components/enhanced-table/enum-filter/EnumFilter.jsx b/src/components/enhanced-table/enum-filter/EnumFilter.tsx similarity index 73% rename from src/components/enhanced-table/enum-filter/EnumFilter.jsx rename to src/components/enhanced-table/enum-filter/EnumFilter.tsx index 7ce620dc8..1b22e19b5 100644 --- a/src/components/enhanced-table/enum-filter/EnumFilter.jsx +++ b/src/components/enhanced-table/enum-filter/EnumFilter.tsx @@ -6,9 +6,30 @@ import ClearIcon from '@mui/icons-material/Clear' import useMenu from '~/hooks/use-menu' import FilterCheckbox from '~/components/enhanced-table/filter-checkbox/FilterCheckbox' -const EnumFilter = ({ column, filter, setFilter, clearFilter }) => { +interface FilterEnum { + value: string + label: string +} + +interface EnumFilterProps { + column: { + filterEnum: FilterEnum[] + } + filter: string[] + setFilter: (filter: string[]) => void + clearFilter: () => void +} + +const EnumFilter: React.FC = ({ + column, + filter, + setFilter, + clearFilter +}) => { const { renderMenu, openMenu } = useMenu() + const isFilterEmpty = filter.length === 0 + const menuItems = column.filterEnum.map((filterEnum) => ( { const endAdornment = (