Skip to content

Commit

Permalink
feat: added option to pass static choices and isClearable to select f…
Browse files Browse the repository at this point in the history
…ilter
  • Loading branch information
pnicolli committed Aug 6, 2024
1 parent bb9a0f1 commit f67acda
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ const SelectFilter = ({
}
}, []);

const select_options = options?.vocabulary
? vocabularies?.[options.vocabulary]?.items
: selectOptions;
const select_options = options?.choices
? options.choices
: options?.vocabulary
? vocabularies?.[options.vocabulary]?.items
: selectOptions;

return (
<div className="me-lg-3 my-2 my-lg-1 filter-wrapper select-filter">
Expand All @@ -70,7 +72,7 @@ const SelectFilter = ({
onChange(id, opt);
}}
options={select_options?.filter((opt) => !!opt.value?.toString()) ?? []}
isClearable={true}
isClearable={options?.isClearable ?? true}
isSearchable={isSearchable}
// components={{
// ClearIndicator: (props) => {
Expand Down

0 comments on commit f67acda

Please sign in to comment.