diff --git a/src/app/collective-rewards/whitelist/components/Search/WhitelistSearch.tsx b/src/app/collective-rewards/whitelist/components/Search/WhitelistSearch.tsx index 63acc391..f5c61162 100644 --- a/src/app/collective-rewards/whitelist/components/Search/WhitelistSearch.tsx +++ b/src/app/collective-rewards/whitelist/components/Search/WhitelistSearch.tsx @@ -1,3 +1,8 @@ +import { + BuilderStatusActive, + BuilderStatusInProgress, + BuilderStatusShown, +} from '@/app/collective-rewards/types' import { BuilderStatusFilter, useWhitelistContext } from '@/app/collective-rewards/whitelist' import { useAlertContext } from '@/app/providers' import { Input } from '@/components/Input' @@ -5,6 +10,18 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@ import { Label } from '@/components/Typography' import { useEffect } from 'react' +type SelectOption = { + value: BuilderStatusShown | 'all' + label: string +} + +// TODO: are there other statuses to be considered? +const statuses: SelectOption[] = [ + { value: 'all', label: 'All' }, + { value: BuilderStatusActive, label: 'Activated' }, + { value: BuilderStatusInProgress, label: 'In progress' }, +] + export const WhitelistSearch = () => { const { search, filterBy, error: whitelistError } = useWhitelistContext() const { setMessage: setErrorMessage } = useAlertContext() @@ -20,13 +37,6 @@ export const WhitelistSearch = () => { } }, [whitelistError, setErrorMessage]) - // TODO: are there other statuses to be considered? - const statuses = [ - { value: 'all', label: 'All' }, - { value: 'Whitelisted', label: 'Whitelisted' }, - { value: 'In progress', label: 'In progress' }, - ] - const onValueChange = (value: string) => filterBy.onChange(value as BuilderStatusFilter) return (