diff --git a/client/src/app/features/search/apis/search-api.ts b/client/src/app/features/search/apis/search-api.ts index 26c119a..14912aa 100644 --- a/client/src/app/features/search/apis/search-api.ts +++ b/client/src/app/features/search/apis/search-api.ts @@ -1,5 +1,6 @@ import type { ApiWorldHeritageDto, + CriteriaCode, ListResult, Pagination, StudyRegion, @@ -16,6 +17,8 @@ export type SearchParams = { category?: string; yearInscribedFrom?: number; yearInscribedTo?: number; + isEndangered?: boolean; + criteria?: readonly CriteriaCode[]; currentPage?: number; perPage?: number; }; @@ -72,6 +75,10 @@ export const createSearchApi = ({ apiBase, fetchImpl = fetch }: SearchApiDeps) = if (category) queryParams.set("category", category); if (yearInscribedFrom) queryParams.set("year_inscribed_from", yearInscribedFrom); if (yearInscribedTo) queryParams.set("year_inscribed_to", yearInscribedTo); + if (params.isEndangered === true) queryParams.set("is_endangered", "true"); + if (params.criteria && params.criteria.length > 0) { + queryParams.set("criteria", params.criteria.join(",")); + } if (params.currentPage != null) queryParams.set("current_page", String(params.currentPage)); if (params.perPage != null) queryParams.set("per_page", String(params.perPage)); diff --git a/client/src/app/features/search/components/SearchResultsPage.tsx b/client/src/app/features/search/components/SearchResultsPage.tsx index 911e3fc..5915e8f 100644 --- a/client/src/app/features/search/components/SearchResultsPage.tsx +++ b/client/src/app/features/search/components/SearchResultsPage.tsx @@ -7,6 +7,8 @@ import { HeritageCard } from "@features/top/cards/HeritageCard"; import { Pagination } from "@features/top/components/Pagination.tsx"; import { BreadcrumbList } from "@shared/components/BreadcrumbList.tsx"; import { SearchResultMapComponent } from "@features/search/components/SearchResultMapComponent.tsx"; +import { LocaleToggle } from "@shared/locale/LocaleToggle.tsx"; +import { useText } from "@shared/locale/ui-text.ts"; type Props = { header?: ReactNode; @@ -31,6 +33,7 @@ export default function SearchResultsPage({ onPageChange, onBackToAllSites, }: Props) { + const text = useText(); return (
@@ -69,11 +72,12 @@ export default function SearchResultsPage({ h-9 rounded-xl border border-zinc-200 bg-white px-3 text-xs font-semibold text-zinc-700 shadow-sm transition hover:bg-zinc-50 " - aria-label="Back to all sites" + aria-label={text.backToAllSites} > - Back to all sites + {text.backToAllSites} ) : null} +
@@ -87,7 +91,7 @@ export default function SearchResultsPage({ {items.length === 0 ? (
-

No sites found.

+

{text.noSitesFound}

) : (