-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add all functionality mentioned in Notion task (dropdown w/ multi-sel…
…ect, filtering, table)
- Loading branch information
Showing
10 changed files
with
295 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react'; | ||
import Select from 'react-select'; | ||
import { | ||
FormControl, | ||
FormLabel, | ||
} from '@chakra-ui/react'; | ||
|
||
interface FilterDropdownProps { | ||
label: string; | ||
options: { value: string; label: string }[]; | ||
selectedOptions: { value: string; label: string }[]; | ||
onChange: (selectedOptions: { value: string; label: string }[]) => void; | ||
isMulti?: boolean; | ||
} | ||
|
||
const FilterDropdown: React.FC<FilterDropdownProps> = ({ | ||
label, | ||
options, | ||
selectedOptions, | ||
onChange, | ||
isMulti = false, | ||
}) => { | ||
const handleChange = (selected: any) => { | ||
onChange(selected || []); | ||
}; | ||
|
||
return ( | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore | ||
<FormControl> | ||
<FormLabel>{label}</FormLabel> | ||
<Select | ||
isMulti={isMulti} | ||
options={options} | ||
value={selectedOptions} | ||
onChange={handleChange} | ||
placeholder={`Select ${label.toLowerCase()}`} | ||
/> | ||
</FormControl> | ||
); | ||
}; | ||
|
||
export default FilterDropdown; |
Oops, something went wrong.