@@ -11,6 +11,7 @@ import { textType } from "@shared/styles/typography";
1111import { useSetBreadcrumbLabel } from "@features/breadcrumbs/BreadCrumbHooks.ts" ;
1212import { BreadcrumbList } from "@shared/components/BreadcrumbList.tsx" ;
1313import { useLocale } from "@shared/locale/LocaleHooks.ts" ;
14+ import { useText } from "@shared/locale/ui-text.ts" ;
1415
1516const DEFAULT_SEARCH : SearchValues = {
1617 region : "" ,
@@ -20,12 +21,6 @@ const DEFAULT_SEARCH: SearchValues = {
2021 yearInscribedTo : "" ,
2122} ;
2223
23- const TABS : readonly { label : string ; href : `#${string } ` } [ ] = [
24- { label : "Description" , href : "#content" } ,
25- { label : "Maps" , href : "#geo-map" } ,
26- { label : "Gallery" , href : "#gallery" } ,
27- ] as const ;
28-
2924const formatCriteriaInline = ( criteria : string [ ] | undefined ) =>
3025 criteria ?. length ? criteria . map ( ( c ) => `(${ c } )` ) . join ( "" ) : "—" ;
3126
@@ -59,30 +54,31 @@ function HeritageDetailTabs({
5954
6055// Key exam info: visible without scrolling on all screen sizes.
6156function KeyExamInfo ( { item } : { item : WorldHeritageDetailVm } ) {
57+ const t = useText ( ) ;
6258 return (
6359 < div className = "mx-auto w-full max-w-6xl px-4 mt-4" >
6460 < div className = "flex flex-wrap gap-x-6 gap-y-2" >
6561 < div >
6662 < div className = "text-[10px] font-semibold text-zinc-400 uppercase tracking-wide" >
67- Region
63+ { t . region }
6864 </ div >
6965 < div className = "text-sm font-semibold text-zinc-900" > { item . region ?? "—" } </ div >
7066 </ div >
7167 < div >
7268 < div className = "text-[10px] font-semibold text-zinc-400 uppercase tracking-wide" >
73- Category
69+ { t . category }
7470 </ div >
7571 < div className = "text-sm font-semibold text-zinc-900" > { item . category ?? "—" } </ div >
7672 </ div >
7773 < div >
7874 < div className = "text-[10px] font-semibold text-zinc-400 uppercase tracking-wide" >
79- Year Inscribed
75+ { t . yearInscribed }
8076 </ div >
8177 < div className = "text-sm font-semibold text-zinc-900" > { item . yearInscribed ?? "—" } </ div >
8278 </ div >
8379 < div >
8480 < div className = "text-[10px] font-semibold text-zinc-400 uppercase tracking-wide" >
85- Criteria
81+ { t . criteria }
8682 </ div >
8783 < div className = "text-sm font-semibold text-zinc-900" >
8884 { formatCriteriaInline ( item . criteria ) }
@@ -98,6 +94,12 @@ export function HeritageDetailLayout({ item }: { item: WorldHeritageDetailVm })
9894 const setLabel = useSetBreadcrumbLabel ( ) ;
9995 const navigate = useNavigate ( ) ;
10096 const { locale, toggleLocale } = useLocale ( ) ;
97+ const t = useText ( ) ;
98+ const tabs : readonly { label : string ; href : `#${string } ` } [ ] = [
99+ { label : t . description , href : "#content" } ,
100+ { label : t . maps , href : "#geo-map" } ,
101+ { label : t . gallery , href : "#gallery" } ,
102+ ] ;
101103
102104 const handleSubmit = ( q : Partial < SearchValues > ) => {
103105 const next = { ...search , ...q } ;
@@ -124,7 +126,7 @@ export function HeritageDetailLayout({ item }: { item: WorldHeritageDetailVm })
124126 < HeritageSubHeader value = { search } onChange = { setSearch } onSubmit = { handleSubmit } />
125127
126128 < div className = "mx-auto w-full max-w-6xl px-4 mt-6 md:mt-8 flex items-center justify-between" >
127- < HeritageDetailTabs items = { TABS } />
129+ < HeritageDetailTabs items = { tabs } />
128130 < button
129131 onClick = { toggleLocale }
130132 className = "rounded-full border border-zinc-200 px-3 py-1.5 text-xs font-semibold text-zinc-700 hover:bg-zinc-100 shrink-0"
0 commit comments