feat: add Head component for dynamic title in Scheda Annuncio page
This commit is contained in:
parent
06e156c314
commit
cc5e80c3f6
2 changed files with 20 additions and 20 deletions
|
|
@ -1,6 +1,5 @@
|
|||
"use client";
|
||||
|
||||
import Head from "next/head";
|
||||
import { useRef } from "react";
|
||||
import { useReactToPrint } from "react-to-print";
|
||||
import { Button } from "~/components/ui/button";
|
||||
|
|
@ -21,25 +20,20 @@ export function SchedaAnnuncioStampabile({ data }: { data: Annunci }) {
|
|||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Scheda Annuncio {data.codice}</title>
|
||||
</Head>
|
||||
<div className="mx-auto max-w-4xl">
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-2xl font-bold">Scheda Annuncio Stampabile</h1>
|
||||
<div className="mx-auto max-w-4xl">
|
||||
<div className="space-y-6">
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-2xl font-bold">Scheda Annuncio Stampabile</h1>
|
||||
|
||||
<Button className="print:hidden" onClick={() => reactToPrintFn()}>
|
||||
Stampa
|
||||
</Button>
|
||||
</div>
|
||||
<div ref={contentRef}>
|
||||
<SchedaAnnuncio data={data} />
|
||||
</div>
|
||||
<Button className="print:hidden" onClick={() => reactToPrintFn()}>
|
||||
Stampa
|
||||
</Button>
|
||||
</div>
|
||||
<div ref={contentRef}>
|
||||
<SchedaAnnuncio data={data} />
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { GetServerSideProps } from "next";
|
||||
import Head from "next/head";
|
||||
import { AreaRiservataLayout } from "~/components/Layout";
|
||||
import { LoadingPage } from "~/components/loading";
|
||||
import { SchedaAnnuncioStampabile } from "~/components/schedaAnnuncioStampabile";
|
||||
|
|
@ -27,9 +28,14 @@ const SchedaAnnuncioPage: NextPageWithLayout<PageProps> = ({
|
|||
return <Status500 />;
|
||||
}
|
||||
return (
|
||||
<div className="mx-auto w-full p-4">
|
||||
<SchedaAnnuncioStampabile data={data} />
|
||||
</div>
|
||||
<>
|
||||
<Head>
|
||||
<title>Scheda Annuncio {data.codice}</title>
|
||||
</Head>
|
||||
<div className="mx-auto w-full p-4">
|
||||
<SchedaAnnuncioStampabile data={data} />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue