Skip to content

Commit

Permalink
Use shouldShowInvalidSearchPage helper function in search result comp
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamik10 committed Apr 19, 2024
1 parent 56d1264 commit 373a047
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/apps/search-result/search-result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import useFilterHandler from "./useFilterHandler";
import SearchResultSkeleton from "./search-result-skeleton";
import SearchResultZeroHits from "./search-result-zero-hits";
import SearchResultInvalidSearch from "./search-result-not-valid-search";
import { shouldShowInvalidSearchPage } from "./helper";

interface SearchResultProps {
q: string;
Expand Down Expand Up @@ -166,7 +167,7 @@ const SearchResult: React.FC<SearchResultProps> = ({ q, pageSize }) => {
if (filtersUrlParam !== "usePersistedFilters") clearFilter();
}, [clearFilter]);

if (!qUrlParameter || qUrlParameter.length < 3) {
if (shouldShowInvalidSearchPage(q, qUrlParameter)) {
return <SearchResultInvalidSearch />;
}

Expand Down

0 comments on commit 373a047

Please sign in to comment.