Skip to content

Commit

Permalink
fix: filter activated builders
Browse files Browse the repository at this point in the history
  • Loading branch information
antomor committed Nov 19, 2024
1 parent 45266c0 commit 573c68b
Showing 1 changed file with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import { BuilderStatusShown } from '@/app/collective-rewards/types'
import { BuilderStatusFilter, useWhitelistContext } from '@/app/collective-rewards/whitelist'
import { useAlertContext } from '@/app/providers'
import { Input } from '@/components/Input'
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/Select'
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: 'Active', label: 'Activated' },
{ value: 'In progress', label: 'In progress' },
]

export const WhitelistSearch = () => {
const { search, filterBy, error: whitelistError } = useWhitelistContext()
const { setMessage: setErrorMessage } = useAlertContext()
Expand All @@ -20,13 +33,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 (
Expand Down

0 comments on commit 573c68b

Please sign in to comment.