44
55// Importation des dépendances.
66import Link from "next/link" ;
7- import { setRequestLocale } from "next-intl/server " ;
7+ import type { Metadata } from "next" ;
88import { lazy , type ReactNode } from "react" ;
9+ import { getTranslations , setRequestLocale } from "next-intl/server" ;
910
1011// Importation des fonctions utilitaires.
1112import { auth } from "@/utilities/next-auth" ;
@@ -15,9 +16,21 @@ import { fetchMetadata } from "@/utilities/metadata";
1516import { Separator } from "../components/ui/separator" ;
1617
1718const UserMenu = lazy ( ( ) => import ( "../components/user-menu" ) ) ;
19+ const FadeText = lazy ( ( ) => import ( "../components/ui/thirdparty/fade-text" ) ) ;
1820const Navigation = lazy ( ( ) => import ( "../components/navigation" ) ) ;
1921const Notification = lazy ( ( ) => import ( "../components/notification" ) ) ;
2022
23+ // Déclaration des propriétés de la page.
24+ export async function generateMetadata ( ) : Promise < Metadata >
25+ {
26+ const metadata = await fetchMetadata ( ) ;
27+ const messages = await getTranslations ( ) ;
28+
29+ return {
30+ title : `${ messages ( "header.legal_notices" ) } – ${ metadata . title } `
31+ } ;
32+ }
33+
2134export default async function Layout ( {
2235 children,
2336 params
@@ -34,6 +47,7 @@ export default async function Layout( {
3447 // Déclaration des constantes.
3548 const meta = await fetchMetadata ( ) ;
3649 const session = await auth ( ) ;
50+ const messages = await getTranslations ( ) ;
3751
3852 // Affichage du rendu HTML de la page.
3953 return (
@@ -68,7 +82,35 @@ export default async function Layout( {
6882 < Separator />
6983
7084 { /* Contenu de la page */ }
71- { children }
85+ < main className = "container mx-auto max-w-[1440px] p-8 max-md:p-4 max-md:pb-8" >
86+ { /* En-tête de la page */ }
87+ < header >
88+ < FadeText
89+ as = "h2"
90+ className = "text-2xl font-bold tracking-tight"
91+ direction = "left"
92+ >
93+ { messages ( "header.legal_notices" ) }
94+ </ FadeText >
95+
96+ < FadeText
97+ as = "p"
98+ delay = { 0.2 }
99+ className = "text-muted-foreground"
100+ direction = "left"
101+ >
102+ { messages ( "legal.description" ) }
103+ </ FadeText >
104+ </ header >
105+
106+ { /* Barre verticale de séparation */ }
107+ < Separator className = "mb-6 mt-4 md:mb-8 md:mt-6" />
108+
109+ { /* Contenu principal */ }
110+ < section className = "flex flex-col space-y-6 text-justify text-sm" >
111+ { children }
112+ </ section >
113+ </ main >
72114 </ >
73115 ) ;
74116}
0 commit comments