fix(ui): fix sessions search modal
This commit is contained in:
parent
6f75e7a059
commit
183bddd1c4
1 changed files with 3 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ export const getMatchingEntries = (searchQuery: string, filters: Record<string,
|
|||
const filtersQuery = filters[name]
|
||||
.filter(filterOption => filterOption.label.toLocaleLowerCase().includes(searchQuery))
|
||||
|
||||
matchingFilters[name] = filtersQuery
|
||||
if (filtersQuery.length > 0) matchingFilters[name] = filtersQuery
|
||||
filtersQuery.length > 0 && matchingCategories.push(name);
|
||||
}
|
||||
})
|
||||
|
|
@ -61,6 +61,7 @@ function FilterModal(props: Props) {
|
|||
const isResultEmpty = (!filterSearchList || Object.keys(filterSearchList).length === 0)
|
||||
&& matchingCategories.length === 0 && Object.keys(matchingFilters).length === 0
|
||||
|
||||
// console.log(matchingFilters)
|
||||
return (
|
||||
<div className={stl.wrapper} style={{ width: '480px', maxHeight: '380px', overflowY: 'auto'}}>
|
||||
<div className={searchQuery && !isResultEmpty ? 'mb-6' : ''} style={{ columns: "auto 200px" }}>
|
||||
|
|
@ -69,7 +70,7 @@ function FilterModal(props: Props) {
|
|||
<div className="mb-6" key={key}>
|
||||
<div className="uppercase font-medium mb-1 color-gray-medium tracking-widest text-sm">{key}</div>
|
||||
<div>
|
||||
{matchingFilters[key].map((filter: any) => (
|
||||
{matchingFilters[key] && matchingFilters[key].map((filter: any) => (
|
||||
<div key={filter.label} className={cn(stl.optionItem, "flex items-center py-2 cursor-pointer -mx-2 px-2")} onClick={() => onFilterClick({ ...filter, value: [''] })}>
|
||||
<Icon name={filter.icon} size="16"/>
|
||||
<span className="ml-2">{filter.label}</span>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue