in src/views/Search/CheckboxFilter.tsx [100:131]
name: eventName(SEARCH_ANALYTICS.FILTERS, name, "Filter", item.display),
})
);
onValueChange(item.value);
};
let alwaysShow: typeof options = options;
let showWhenExpanded: typeof options = [];
if (initialItemCount) {
alwaysShow = options.slice(0, initialItemCount);
showWhenExpanded = options.slice(initialItemCount, options.length);
}
const isExpandible = showWhenExpanded.length > 0;
return (
<Flex data-testid={dataTestid} direction="column">
<FilterHeading hint={hint} name={name} />
<Stack mt={1} spacing={1}>
{alwaysShow.map((item) => (
<CheckboxItem
{...item}
isChecked={checkedValues.includes(item.value)}
key={item.value}
onChange={getOnChange(item)}
/>
))}
{isExpandible && (
<Collapse animateOpacity in={collapse.isOpen} unmountOnExit>
<Stack spacing={1}>
{showWhenExpanded.map((item) => (