diff --git a/app/components/FilterOptions.tsx b/app/components/FilterOptions.tsx index b4d931a9a0..bd0c3db52e 100644 --- a/app/components/FilterOptions.tsx +++ b/app/components/FilterOptions.tsx @@ -9,14 +9,15 @@ import { Outline } from "./Input"; import InputSearch from "./InputSearch"; import PaginatedList, { PaginatedItem } from "./PaginatedList"; -type TFilterOption = PaginatedItem & { +type TFilterOption = { + id: string; key: string; label: string; note?: string; }; -type Props = { - options: T[]; +type Props = { + options: TFilterOption[]; activeKey: string | null | undefined; defaultLabel?: string; selectedPrefix?: string; @@ -25,10 +26,10 @@ type Props = { searchable?: boolean; paginateFetch?: ( options: PaginatedItem - ) => Promise; + ) => Promise; }; -const FilterOptions = ({ +const FilterOptions = ({ options, activeKey = "", defaultLabel = "Filter options", @@ -37,11 +38,11 @@ const FilterOptions = ({ onSelect, searchable, paginateFetch, -}: Props) => { +}: Props) => { const menu = useMenuState({ modal: true, }); - const [filteredData, setFilteredData] = React.useState([]); + const [filteredData, setFilteredData] = React.useState([]); const selected = options.find((option) => option.key === activeKey) || options[0];