From 1baf4bca2c20f616a48f17e55dff053f811d19e3 Mon Sep 17 00:00:00 2001 From: Siarhei Karol Date: Fri, 6 Dec 2024 13:30:46 +0300 Subject: [PATCH] migrate search store --- .../hooks/useComplexLookupSearchResults.ts | 6 +- src/common/hooks/useFetchSearchData.ts | 9 +- src/common/hooks/useLoadSearchResults.ts | 10 +- src/common/hooks/useNavigateToEditPage.ts | 5 +- src/common/hooks/usePagination.ts | 5 +- src/common/hooks/useSearch.ts | 35 ++++--- .../hooks/useSearchFilterLookupOptions.ts | 6 +- src/common/hooks/useSearchFilters.ts | 11 +-- src/common/hooks/useSearchFiltersData.ts | 10 +- src/common/hooks/useSearchNavigationState.ts | 5 +- .../AdvancedSearchModal.tsx | 6 +- src/components/Announcement/index.ts | 1 + .../ComplexLookupField/ModalComplexLookup.tsx | 7 +- .../SearchControlPane/SearchControlPane.tsx | 5 +- .../SearchControls/SearchControls.tsx | 23 +++-- .../SearchFilters/SearchFilters.tsx | 4 +- .../SearchResultEntry/SearchResultEntry.tsx | 6 +- .../SearchResultList/SearchResultList.tsx | 5 +- src/state/index.ts | 5 - src/state/search.ts | 82 ----------------- src/store/index.ts | 1 + src/store/search.ts | 42 +++++++++ src/store/selectors.ts | 2 + .../useComplesLookupSearchResults.test.ts | 12 ++- .../common/hooks/useLoadSearchResults.test.ts | 44 ++++----- .../hooks/useNavigateToEditPage.test.ts | 29 +++--- .../common/hooks/usePagination.test.ts | 87 ++++++++++++------ .../__tests__/common/hooks/useSearch.test.ts | 92 +++++++++---------- .../useSearchFilterLookupOptions.test.ts | 11 ++- .../common/hooks/useSearchFilters.test.tsx | 34 ++++--- .../common/hooks/useSearchFiltersData.test.ts | 36 +++++--- .../hooks/useSearchNavigationState.test.ts | 26 +++--- .../__tests__/components/ItemSearch.test.tsx | 17 ++-- .../components/SearchControls.test.tsx | 12 ++- .../components/SearchResultList.test.tsx | 24 +++-- 35 files changed, 361 insertions(+), 354 deletions(-) create mode 100644 src/components/Announcement/index.ts delete mode 100644 src/state/index.ts delete mode 100644 src/state/search.ts diff --git a/src/common/hooks/useComplexLookupSearchResults.ts b/src/common/hooks/useComplexLookupSearchResults.ts index 474f839a..fb068384 100644 --- a/src/common/hooks/useComplexLookupSearchResults.ts +++ b/src/common/hooks/useComplexLookupSearchResults.ts @@ -1,10 +1,9 @@ import { useCallback, useMemo } from 'react'; -import { useRecoilValue } from 'recoil'; import { useIntl } from 'react-intl'; import { type Row } from '@components/Table'; import { useSearchContext } from '@common/hooks/useSearchContext'; import { ComplexLookupSearchResultsProps } from '@components/ComplexLookupField/ComplexLookupSearchResults'; -import state from '@state'; +import { useSearchState } from '@src/store'; export const useComplexLookupSearchResults = ({ onTitleClick, @@ -12,8 +11,7 @@ export const useComplexLookupSearchResults = ({ searchResultsFormatter, }: ComplexLookupSearchResultsProps) => { const { onAssignRecord } = useSearchContext(); - const data = useRecoilValue(state.search.data); - const sourceData = useRecoilValue(state.search.sourceData); + const { data, sourceData } = useSearchState(); const { formatMessage } = useIntl(); const applyActionItems = useCallback( diff --git a/src/common/hooks/useFetchSearchData.ts b/src/common/hooks/useFetchSearchData.ts index 7101d4ee..cc445039 100644 --- a/src/common/hooks/useFetchSearchData.ts +++ b/src/common/hooks/useFetchSearchData.ts @@ -1,5 +1,4 @@ import { useCallback } from 'react'; -import { useSetRecoilState, useRecoilState, useResetRecoilState } from 'recoil'; import { getByIdentifier } from '@common/api/search.api'; import { SearchIdentifiers, SearchSegment } from '@common/constants/search.constants'; import { SearchableIndexQuerySelector } from '@common/constants/complexLookup.constants'; @@ -7,8 +6,7 @@ import { StatusType } from '@common/constants/status.constants'; import { normalizeQuery } from '@common/helpers/search.helper'; import { normalizeLccn } from '@common/helpers/validations.helper'; import { UserNotificationFactory } from '@common/services/userNotification'; -import { useLoadingState, useStatusState } from '@src/store'; -import state from '@state'; +import { useLoadingState, useSearchState, useStatusState } from '@src/store'; import { useSearchContext } from './useSearchContext'; export const useFetchSearchData = () => { @@ -26,10 +24,7 @@ export const useFetchSearchData = () => { precedingRecordsCount, } = useSearchContext(); const { setIsLoading } = useLoadingState(); - const setMessage = useSetRecoilState(state.search.message); - const [data, setData] = useRecoilState(state.search.data); - const resetData = useResetRecoilState(state.search.data); - const setPageMetadata = useSetRecoilState(state.search.pageMetadata); + const { setMessage, data, setData, resetData, setPageMetadata } = useSearchState(); const { addStatusMessage, resetStatusMessages } = useStatusState(); const validateAndNormalizeQuery = useCallback( diff --git a/src/common/hooks/useLoadSearchResults.ts b/src/common/hooks/useLoadSearchResults.ts index 344baab9..0acd00a1 100644 --- a/src/common/hooks/useLoadSearchResults.ts +++ b/src/common/hooks/useLoadSearchResults.ts @@ -1,10 +1,8 @@ import { useEffect, useRef } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { useRecoilState, useResetRecoilState, useSetRecoilState } from 'recoil'; import { SearchQueryParams } from '@common/constants/routes.constants'; import { SEARCH_RESULTS_LIMIT, SearchIdentifiers } from '@common/constants/search.constants'; -import { useLoadingState } from '@src/store'; -import state from '@state'; +import { useLoadingState, useSearchState } from '@src/store'; import { useSearchContext } from './useSearchContext'; export const useLoadSearchResults = ( @@ -12,12 +10,8 @@ export const useLoadSearchResults = ( ) => { const { hasSearchParams, defaultSearchBy, defaultQuery, getSearchSourceData, getSearchFacetsData } = useSearchContext(); - const setData = useSetRecoilState(state.search.data); - const setSearchBy = useSetRecoilState(state.search.index); const { setIsLoading } = useLoadingState(); - const setQuery = useSetRecoilState(state.search.query); - const [forceRefresh, setForceRefresh] = useRecoilState(state.search.forceRefresh); - const resetFacetsData = useResetRecoilState(state.search.facetsData); + const { setQuery, setData, setSearchBy, forceRefresh, setForceRefresh, resetFacetsData } = useSearchState(); const [searchParams] = useSearchParams(); const queryParam = searchParams.get(SearchQueryParams.Query); const searchByParam = searchParams.get(SearchQueryParams.SearchBy); diff --git a/src/common/hooks/useNavigateToEditPage.ts b/src/common/hooks/useNavigateToEditPage.ts index 79670bc9..a458e520 100644 --- a/src/common/hooks/useNavigateToEditPage.ts +++ b/src/common/hooks/useNavigateToEditPage.ts @@ -1,11 +1,10 @@ import { ROUTES, QueryParams } from '@common/constants/routes.constants'; -import state from '@state'; +import { useSearchState } from '@src/store'; import { useNavigate } from 'react-router-dom'; -import { useRecoilValue } from 'recoil'; export const useNavigateToEditPage = () => { const navigate = useNavigate(); - const navigationState = useRecoilValue(state.search.navigationState); + const { navigationState } = useSearchState(); const navigateAsDuplicate = (duplicateId: string) => { navigate(`${ROUTES.RESOURCE_CREATE.uri}?${QueryParams.CloneOf}=${duplicateId}`, { state: navigationState }); diff --git a/src/common/hooks/usePagination.ts b/src/common/hooks/usePagination.ts index d28b8368..134e896c 100644 --- a/src/common/hooks/usePagination.ts +++ b/src/common/hooks/usePagination.ts @@ -1,13 +1,12 @@ import { useEffect, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { useRecoilValue } from 'recoil'; import { SearchQueryParams } from '@common/constants/routes.constants'; -import state from '@state'; +import { useSearchState } from '@src/store'; export const usePagination = (hasSearchParams = true, defaultPageNumber = 0, hasCycledPagination = false) => { const [searchParams, setSearchParams] = useSearchParams(); const offsetSearchParam = searchParams.get(SearchQueryParams.Offset); - const pageMetadata = useRecoilValue(state.search.pageMetadata); + const { pageMetadata } = useSearchState(); const [currentPageNumber, setCurrentPageNumber] = useState( offsetSearchParam ? parseInt(offsetSearchParam) : defaultPageNumber, ); diff --git a/src/common/hooks/useSearch.ts b/src/common/hooks/useSearch.ts index f6334f92..5cac6d9d 100644 --- a/src/common/hooks/useSearch.ts +++ b/src/common/hooks/useSearch.ts @@ -1,6 +1,5 @@ import { useCallback, useEffect } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { useSetRecoilState, useRecoilState, useResetRecoilState } from 'recoil'; import { SearchableIndexQuerySelector } from '@common/constants/complexLookup.constants'; import { DEFAULT_PAGES_METADATA } from '@common/constants/api.constants'; import { SearchIdentifiers, SearchSegment } from '@common/constants/search.constants'; @@ -8,8 +7,7 @@ import { generateSearchParamsState } from '@common/helpers/search.helper'; import { usePagination } from '@common/hooks/usePagination'; import { useSearchContext } from '@common/hooks/useSearchContext'; import { useFetchSearchData } from '@common/hooks/useFetchSearchData'; -import { useInputsState, useLoadingState } from '@src/store'; -import state from '@state'; +import { useInputsState, useLoadingState, useSearchState } from '@src/store'; export const useSearch = () => { const { @@ -23,15 +21,24 @@ export const useSearch = () => { } = useSearchContext(); const { setIsLoading } = useLoadingState(); const { resetPreviewContent } = useInputsState(); - const [searchBy, setSearchBy] = useRecoilState(state.search.index); - const [query, setQuery] = useRecoilState(state.search.query); - const [facets, setFacets] = useRecoilState(state.search.limiters); - const [message, setMessage] = useRecoilState(state.search.message); - const [data, setData] = useRecoilState(state.search.data); - const [pageMetadata, setPageMetadata] = useRecoilState(state.search.pageMetadata); - const setForceRefreshSearch = useSetRecoilState(state.search.forceRefresh); - const [facetsBySegments, setFacetsBySegments] = useRecoilState(state.search.facetsBySegments); - const clearFacetsBySegments = useResetRecoilState(state.search.facetsBySegments); + const { + searchBy, + setSearchBy, + query, + setQuery, + facets, + setFacets, + message, + setMessage, + data, + setData, + pageMetadata, + setPageMetadata, + setForceRefresh: setForceRefreshSearch, + facetsBySegments, + setFacetsBySegments, + resetFacetsBySegments, + } = useSearchState(); const { fetchData } = useFetchSearchData(); const { @@ -199,8 +206,8 @@ export const useSearch = () => { // Reset Segments selection on unmount useEffect(() => { - return clearFacetsBySegments; - }, [clearFacetsBySegments]); + return resetFacetsBySegments; + }, [resetFacetsBySegments]); return { submitSearch, diff --git a/src/common/hooks/useSearchFilterLookupOptions.ts b/src/common/hooks/useSearchFilterLookupOptions.ts index c042725f..82e28362 100644 --- a/src/common/hooks/useSearchFilterLookupOptions.ts +++ b/src/common/hooks/useSearchFilterLookupOptions.ts @@ -1,6 +1,5 @@ -import { useRecoilValue } from 'recoil'; import { useIntl } from 'react-intl'; -import state from '@state'; +import { useSearchState } from '@src/store'; export const useSearchFilterLookupOptions = ({ facet, @@ -10,8 +9,7 @@ export const useSearchFilterLookupOptions = ({ hasMappedSourceData?: boolean; excludedOptions?: string[]; }) => { - const sourceData = useRecoilValue(state.search.sourceData); - const facetsData = useRecoilValue(state.search.facetsData); + const { sourceData, facetsData } = useSearchState(); const { formatMessage } = useIntl(); const facetValues = facet && facetsData ? facetsData?.[facet]?.values : undefined; diff --git a/src/common/hooks/useSearchFilters.ts b/src/common/hooks/useSearchFilters.ts index 626ea7c5..e560de69 100644 --- a/src/common/hooks/useSearchFilters.ts +++ b/src/common/hooks/useSearchFilters.ts @@ -1,20 +1,19 @@ import { ChangeEvent } from 'react'; -import { useRecoilState } from 'recoil'; import { SearchLimiterNames } from '@common/constants/search.constants'; -import state from '@state'; +import { useSearchState } from '@src/store'; export const useSearchFilters = () => { - const [limiters, setLimiters] = useRecoilState(state.search.limiters); + const { facets, setFacets } = useSearchState(); const onChangeLimiters = ({ target: { id, name } }: ChangeEvent) => { - setLimiters(prev => ({ + setFacets(prev => ({ ...prev, [name]: id, })); }; const onChangeLimitersMulti = ({ target: { id, name } }: ChangeEvent) => { - setLimiters(prev => { + setFacets(prev => { const initialLimiters = (prev[name as SearchLimiterNames] as any[]) || []; return { @@ -29,7 +28,7 @@ export const useSearchFilters = () => { const onChange = (_e: ChangeEvent) => {}; return { - limiters, + facets, onChangeLimiters, onChangeLimitersMulti, onChange, diff --git a/src/common/hooks/useSearchFiltersData.ts b/src/common/hooks/useSearchFiltersData.ts index 7e0c6f22..a147b1be 100644 --- a/src/common/hooks/useSearchFiltersData.ts +++ b/src/common/hooks/useSearchFiltersData.ts @@ -1,19 +1,15 @@ import { useEffect } from 'react'; -import { useRecoilState, useResetRecoilState, useSetRecoilState } from 'recoil'; import { StatusType } from '@common/constants/status.constants'; import { UserNotificationFactory } from '@common/services/userNotification'; import * as SearchApi from '@common/api/search.api'; -import state from '@state'; -import { useStatusState } from '@src/store'; +import { useSearchState, useStatusState } from '@src/store'; const DEFAULT_SEARCH_SOURCE_LIMIT = '50'; const DEFAULT_SEARCH_FACETS_QUERY = 'id=*'; export const useSearchFiltersData = () => { - const [selectedFacetsGroups, setSelectedFacetsGroups] = useRecoilState(state.search.selectedFacetsGroups); - const resetSelectedFacetsGroups = useResetRecoilState(state.search.selectedFacetsGroups); - const setFacetsData = useSetRecoilState(state.search.facetsData); - const setSourceData = useSetRecoilState(state.search.sourceData); + const { selectedFacetsGroups, setSelectedFacetsGroups, resetSelectedFacetsGroups, setFacetsData, setSourceData } = + useSearchState(); const { addStatusMessage } = useStatusState(); useEffect(() => { diff --git a/src/common/hooks/useSearchNavigationState.ts b/src/common/hooks/useSearchNavigationState.ts index c5879d05..7a083698 100644 --- a/src/common/hooks/useSearchNavigationState.ts +++ b/src/common/hooks/useSearchNavigationState.ts @@ -1,9 +1,8 @@ import { useEffect } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { useSetRecoilState } from 'recoil'; import { SearchQueryParams } from '@common/constants/routes.constants'; import { generateSearchParamsState } from '@common/helpers/search.helper'; -import state from '@state'; +import { useSearchState } from '@src/store'; export const useSearchNavigationState = () => { const [searchParams] = useSearchParams(); @@ -11,7 +10,7 @@ export const useSearchNavigationState = () => { const searchBySearchParam = searchParams.get(SearchQueryParams.SearchBy); const offsetSearchParam = searchParams.get(SearchQueryParams.Offset); - const setNavigationState = useSetRecoilState(state.search.navigationState); + const { setNavigationState } = useSearchState(); useEffect(() => { const generatedState = generateSearchParamsState( diff --git a/src/components/AdvancedSearchModal/AdvancedSearchModal.tsx b/src/components/AdvancedSearchModal/AdvancedSearchModal.tsx index 040f9c33..b20c7635 100644 --- a/src/components/AdvancedSearchModal/AdvancedSearchModal.tsx +++ b/src/components/AdvancedSearchModal/AdvancedSearchModal.tsx @@ -1,6 +1,5 @@ import { FC, memo, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { useSetRecoilState } from 'recoil'; import { FormattedMessage, useIntl } from 'react-intl'; import { Modal } from '@components/Modal'; import { Input } from '@components/Input'; @@ -12,8 +11,7 @@ import { } from '@common/constants/search.constants'; import { formatRawQuery, generateSearchParamsState } from '@common/helpers/search.helper'; import { Select } from '@components/Select'; -import { useUIState } from '@src/store'; -import state from '@state'; +import { useSearchState, useUIState } from '@src/store'; import './AdvancedSearchModal.scss'; enum AdvancedSearchInputs { @@ -31,7 +29,7 @@ export const AdvancedSearchModal: FC = memo(({ clearValues }) => { const [, setSearchParams] = useSearchParams(); const { formatMessage } = useIntl(); const { isAdvancedSearchOpen: isOpen, setIsAdvancedSearchOpen: setIsOpen } = useUIState(); - const setForceRefreshSearch = useSetRecoilState(state.search.forceRefresh); + const { setForceRefresh: setForceRefreshSearch } = useSearchState(); const [rawQuery, setRawQuery] = useState(DEFAULT_ADVANCED_SEARCH_QUERY); const closeModal = () => { diff --git a/src/components/Announcement/index.ts b/src/components/Announcement/index.ts new file mode 100644 index 00000000..e0f8e918 --- /dev/null +++ b/src/components/Announcement/index.ts @@ -0,0 +1 @@ +export { Announcement } from './Announcement'; diff --git a/src/components/ComplexLookupField/ModalComplexLookup.tsx b/src/components/ComplexLookupField/ModalComplexLookup.tsx index 7991c26c..b8090c16 100644 --- a/src/components/ComplexLookupField/ModalComplexLookup.tsx +++ b/src/components/ComplexLookupField/ModalComplexLookup.tsx @@ -1,5 +1,4 @@ import { FC, memo, useCallback, useEffect } from 'react'; -import { useResetRecoilState, useSetRecoilState } from 'recoil'; import classNames from 'classnames'; import { FormattedMessage, FormattedNumber } from 'react-intl'; import { getSearchResults } from '@common/api/search.api'; @@ -13,13 +12,12 @@ import { useMarcData } from '@common/hooks/useMarcData'; import { COMPLEX_LOOKUPS_CONFIG } from '@src/configs'; import { Modal } from '@components/Modal'; import { Search } from '@components/Search'; +import { useMarcPreviewState, useSearchState, useUIState } from '@src/store'; import { SearchControlPane } from '@components/SearchControlPane'; -import state from '@state'; import { ComplexLookupSearchResults } from './ComplexLookupSearchResults'; import { MarcPreviewComplexLookup } from './MarcPreviewComplexLookup'; import { SEARCH_RESULTS_TABLE_CONFIG } from './configs'; import './ModalComplexLookup.scss'; -import { useMarcPreviewState, useUIState } from '@src/store'; interface ModalComplexLookupProps { isOpen: boolean; @@ -51,8 +49,7 @@ export const ModalComplexLookup: FC = memo( const searchResultsFormatter = SEARCH_RESULTS_FORMATTER[assignEntityName] || SEARCH_RESULTS_FORMATTER.default; const buildSearchQuery = SEARCH_QUERY_BUILDER[assignEntityName] || SEARCH_QUERY_BUILDER.default; - const setSearchQuery = useSetRecoilState(state.search.query); - const clearSearchQuery = useResetRecoilState(state.search.query); + const { setQuery: setSearchQuery, resetQuery: clearSearchQuery } = useSearchState(); const { getFacetsData, getSourceData } = useComplexLookupApi(api, filters); const { setIsMarcPreviewOpen } = useUIState(); const { diff --git a/src/components/SearchControlPane/SearchControlPane.tsx b/src/components/SearchControlPane/SearchControlPane.tsx index e1fa6063..c37d4f9e 100644 --- a/src/components/SearchControlPane/SearchControlPane.tsx +++ b/src/components/SearchControlPane/SearchControlPane.tsx @@ -1,10 +1,9 @@ import { FC } from 'react'; -import { useRecoilValue } from 'recoil'; import classNames from 'classnames'; import { IS_EMBEDDED_MODE } from '@common/constants/build.constants'; import { useSearchContext } from '@common/hooks/useSearchContext'; import { SearchSegment } from '@common/constants/search.constants'; -import state from '@state'; +import { useSearchState } from '@src/store'; import './SearchControlPane.scss'; type SearchControlPaneProps = { @@ -22,7 +21,7 @@ export const SearchControlPane: FC = ({ renderCloseButton, segmentsConfig, }) => { - const searchResultsMetadata = useRecoilValue(state.search.pageMetadata); + const { pageMetadata: searchResultsMetadata } = useSearchState(); const { navigationSegment } = useSearchContext(); const selectedSegment = navigationSegment?.value; const isVisibleSubLabel = segmentsConfig diff --git a/src/components/SearchControls/SearchControls.tsx b/src/components/SearchControls/SearchControls.tsx index 273c1f2d..7e6e2140 100644 --- a/src/components/SearchControls/SearchControls.tsx +++ b/src/components/SearchControls/SearchControls.tsx @@ -1,6 +1,5 @@ import { ChangeEvent, FC, FormEventHandler, useEffect, useState } from 'react'; import { useSearchParams } from 'react-router-dom'; -import { useRecoilState, useResetRecoilState, useSetRecoilState } from 'recoil'; import { FormattedMessage, useIntl } from 'react-intl'; import classNames from 'classnames'; import { DEFAULT_FACET_BY_SEGMENT, SearchIdentifiers } from '@common/constants/search.constants'; @@ -11,13 +10,12 @@ import { Input } from '@components/Input'; import { Select } from '@components/Select'; import { SearchFilters } from '@components/SearchFilters'; import { Textarea } from '@components/Textarea'; +import { Announcement } from '@components/Announcement'; +import { useSearchState, useUIState } from '@src/store'; import SearchSegments from './SearchSegments'; -import state from '@state'; import CaretDown from '@src/assets/caret-down.svg?react'; import XInCircle from '@src/assets/x-in-circle.svg?react'; import './SearchControls.scss'; -import { Announcement } from '@components/Announcement/Announcement'; -import { useUIState } from '@src/store'; type Props = { submitSearch: VoidFunction; @@ -38,12 +36,17 @@ export const SearchControls: FC = ({ submitSearch, changeSegment, clearVa defaultSearchBy, navigationSegment, } = useSearchContext(); - const [searchBy, setSearchBy] = useRecoilState(state.search.index); - const [query, setQuery] = useRecoilState(state.search.query); - const setMessage = useSetRecoilState(state.search.message); - const setNavigationState = useSetRecoilState(state.search.navigationState); - const resetControls = useResetRecoilState(state.search.limiters); - const setFacetsBySegments = useSetRecoilState(state.search.facetsBySegments); + + const { + searchBy, + setSearchBy, + query, + setQuery, + setMessage, + setNavigationState, + resetFacets: resetControls, + setFacetsBySegments, + } = useSearchState(); const { setIsAdvancedSearchOpen } = useUIState(); const [searchParams, setSearchParams] = useSearchParams(); const [announcementMessage, setAnnouncementMessage] = useState(''); diff --git a/src/components/SearchFilters/SearchFilters.tsx b/src/components/SearchFilters/SearchFilters.tsx index 1e8aa6d0..6cc9adb5 100644 --- a/src/components/SearchFilters/SearchFilters.tsx +++ b/src/components/SearchFilters/SearchFilters.tsx @@ -9,7 +9,7 @@ import { DateRange } from '@components/DateRange'; export const SearchFilters = () => { const { filters, getSearchFacetsData } = useSearchContext(); - const { limiters, onChangeLimiters, onChangeLimitersMulti, onChange } = useSearchFilters(); + const { facets, onChangeLimiters, onChangeLimitersMulti, onChange } = useSearchFilters(); const filtersLastGroupIndex = filters.length - 1; return ( @@ -36,7 +36,7 @@ export const SearchFilters = () => { {children?.map(({ id, name, type, labelId }) => (