feat: add Head component for dynamic title in Scheda Annuncio page

This commit is contained in:
Marco Pedone 2025-09-01 11:37:43 +02:00
parent 06e156c314
commit cc5e80c3f6
2 changed files with 20 additions and 20 deletions

View file

@ -1,6 +1,5 @@
"use client"; "use client";
import Head from "next/head";
import { useRef } from "react"; import { useRef } from "react";
import { useReactToPrint } from "react-to-print"; import { useReactToPrint } from "react-to-print";
import { Button } from "~/components/ui/button"; import { Button } from "~/components/ui/button";
@ -21,10 +20,6 @@ export function SchedaAnnuncioStampabile({ data }: { data: Annunci }) {
}); });
return ( return (
<>
<Head>
<title>Scheda Annuncio {data.codice}</title>
</Head>
<div className="mx-auto max-w-4xl"> <div className="mx-auto max-w-4xl">
<div className="space-y-6"> <div className="space-y-6">
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
@ -39,7 +34,6 @@ export function SchedaAnnuncioStampabile({ data }: { data: Annunci }) {
</div> </div>
</div> </div>
</div> </div>
</>
); );
} }

View file

@ -1,4 +1,5 @@
import type { GetServerSideProps } from "next"; import type { GetServerSideProps } from "next";
import Head from "next/head";
import { AreaRiservataLayout } from "~/components/Layout"; import { AreaRiservataLayout } from "~/components/Layout";
import { LoadingPage } from "~/components/loading"; import { LoadingPage } from "~/components/loading";
import { SchedaAnnuncioStampabile } from "~/components/schedaAnnuncioStampabile"; import { SchedaAnnuncioStampabile } from "~/components/schedaAnnuncioStampabile";
@ -27,9 +28,14 @@ const SchedaAnnuncioPage: NextPageWithLayout<PageProps> = ({
return <Status500 />; return <Status500 />;
} }
return ( return (
<>
<Head>
<title>Scheda Annuncio {data.codice}</title>
</Head>
<div className="mx-auto w-full p-4"> <div className="mx-auto w-full p-4">
<SchedaAnnuncioStampabile data={data} /> <SchedaAnnuncioStampabile data={data} />
</div> </div>
</>
); );
}; };