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"
2
4
3
5
import LanguageMorpher from "@/components/Homepage/LanguageMorpher"
4
6
import { Image } from "@/components/Image"
5
7
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
+ }
9
12
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" } )
12
15
13
16
return (
14
17
< div className = { className } >
15
18
< div className = "h-[240px] md:h-[380px] lg:h-[480px]" >
16
19
< Image
17
20
src = { heroImg }
18
- alt = { t ( "page-index:page-index -hero-image-alt" ) }
21
+ alt = { t ( "page-index-hero-image-alt" ) }
19
22
// TODO: adjust value when the old theme breakpoints are removed (src/theme.ts)
20
23
sizes = "(max-width: 1504px) 100vw, 1504px"
21
24
className = "h-full w-full object-cover"
@@ -25,9 +28,9 @@ const HomeHero = ({ heroImg, className }: HomeHeroProps) => {
25
28
< div className = "flex flex-col items-center border-t-[3px] border-primary-low-contrast px-4 py-10 text-center" >
26
29
< LanguageMorpher />
27
30
< 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 >
29
32
< 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" ) }
31
34
</ p >
32
35
</ div >
33
36
</ div >
0 commit comments