1- import type { ClassNameProp , CommonHeroProps } from "@/lib/types"
1+ import { getTranslations } from "next-intl/server"
2+
3+ import type { ClassNameProp , CommonHeroProps , Lang } from "@/lib/types"
24
35import LanguageMorpher from "@/components/Homepage/LanguageMorpher"
46import { Image } from "@/components/Image"
57
6- import useTranslation from "@/hooks/useTranslation"
7-
8- export type HomeHeroProps = Pick < CommonHeroProps , "heroImg" > & ClassNameProp
8+ export type HomeHeroProps = Pick < CommonHeroProps , "heroImg" > &
9+ ClassNameProp & {
10+ locale : Lang
11+ }
912
10- const HomeHero = ( { heroImg, className } : HomeHeroProps ) => {
11- const { t } = useTranslation ( "page-index" )
13+ const HomeHero = async ( { heroImg, className, locale } : HomeHeroProps ) => {
14+ const t = await getTranslations ( { locale , namespace : "page-index" } )
1215
1316 return (
1417 < div className = { className } >
1518 < div className = "h-[240px] md:h-[380px] lg:h-[480px]" >
1619 < Image
1720 src = { heroImg }
18- alt = { t ( "page-index:page-index -hero-image-alt" ) }
21+ alt = { t ( "page-index-hero-image-alt" ) }
1922 // TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
2023 sizes = "(max-width: 1504px) 100vw, 1504px"
2124 className = "h-full w-full object-cover"
@@ -25,9 +28,9 @@ const HomeHero = ({ heroImg, className }: HomeHeroProps) => {
2528 < div className = "flex flex-col items-center border-t-[3px] border-primary-low-contrast px-4 py-10 text-center" >
2629 < LanguageMorpher />
2730 < div className = "flex flex-col items-center gap-y-5 lg:max-w-2xl" >
28- < h1 className = "font-black" > { t ( "page-index:page-index -title" ) } </ h1 >
31+ < h1 className = "font-black" > { t ( "page-index-title" ) } </ h1 >
2932 < p className = "max-w-96 text-md text-body-medium lg:text-lg" >
30- { t ( "page-index:page-index -description" ) }
33+ { t ( "page-index-description" ) }
3134 </ p >
3235 </ div >
3336 </ div >
0 commit comments