2025-08-04 17:45:44 +02:00
|
|
|
import type { NextPage } from "next";
|
|
|
|
|
import Head from "next/head";
|
2026-05-12 16:10:01 +02:00
|
|
|
import HowItWorks from "~/components/how-it-works";
|
2025-08-04 17:45:44 +02:00
|
|
|
import {
|
2025-08-28 18:27:07 +02:00
|
|
|
Accordion,
|
|
|
|
|
AccordionContent,
|
|
|
|
|
AccordionItem,
|
|
|
|
|
AccordionTrigger,
|
2025-08-04 17:45:44 +02:00
|
|
|
} from "~/components/ui/accordion";
|
2025-11-14 17:21:21 +01:00
|
|
|
import { Badge } from "~/components/ui/badge";
|
2025-08-28 18:27:07 +02:00
|
|
|
import { useTranslation } from "~/providers/I18nProvider";
|
2025-08-04 17:45:44 +02:00
|
|
|
|
2026-03-09 17:33:02 +01:00
|
|
|
/**
|
|
|
|
|
* Pagina guida: /guida
|
|
|
|
|
*/
|
2025-08-04 17:45:44 +02:00
|
|
|
const Guida: NextPage = () => {
|
2025-08-28 18:27:07 +02:00
|
|
|
const { t } = useTranslation();
|
2025-08-04 17:45:44 +02:00
|
|
|
|
2025-08-28 18:27:07 +02:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<Head>
|
|
|
|
|
<title>{t.heads.guida_titolo}</title>
|
2025-08-29 16:18:32 +02:00
|
|
|
<meta content={t.heads.main_description} name="description" />
|
2025-08-28 18:27:07 +02:00
|
|
|
</Head>
|
2026-05-12 16:10:01 +02:00
|
|
|
<main className="mx-auto flex w-full max-w-8xl flex-col px-2 py-5 md:px-8">
|
2025-11-17 19:21:40 +01:00
|
|
|
<Badge className="bg-muted py-1 text-foreground text-sm outline outline-muted-foreground">
|
2025-08-28 18:27:07 +02:00
|
|
|
{t.guida}
|
2025-11-14 17:21:21 +01:00
|
|
|
</Badge>
|
2025-08-04 17:45:44 +02:00
|
|
|
|
2026-05-12 16:10:01 +02:00
|
|
|
{/* <ComeFunziona /> */}
|
2026-05-12 18:43:00 +02:00
|
|
|
<HowItWorks className="sm:mt-1" />
|
2025-08-28 18:27:07 +02:00
|
|
|
<FAQSection />
|
|
|
|
|
</main>
|
|
|
|
|
</>
|
|
|
|
|
);
|
2025-08-04 17:45:44 +02:00
|
|
|
};
|
|
|
|
|
export default Guida;
|
|
|
|
|
|
|
|
|
|
const FAQSection = () => {
|
2025-08-28 18:27:07 +02:00
|
|
|
const { t } = useTranslation();
|
2025-08-04 17:45:44 +02:00
|
|
|
|
2025-08-28 18:27:07 +02:00
|
|
|
if (!t.faq?.domande) {
|
|
|
|
|
return null; // Ensure translations are loaded before rendering
|
|
|
|
|
}
|
2025-08-04 17:45:44 +02:00
|
|
|
|
2025-08-28 18:27:07 +02:00
|
|
|
return (
|
2026-05-12 16:10:01 +02:00
|
|
|
<section className="px-4 py-8 sm:py-12 md:px-6" id="faq">
|
|
|
|
|
<div className="mx-auto grid max-w-5xl items-center gap-6">
|
2025-11-14 17:21:21 +01:00
|
|
|
<div className="flex flex-col justify-center space-y-4">
|
2025-08-28 18:27:07 +02:00
|
|
|
<div className="space-y-2">
|
2025-10-10 16:18:43 +02:00
|
|
|
<h2 className="font-bold text-3xl tracking-tighter md:text-4xl">
|
2025-08-28 18:27:07 +02:00
|
|
|
{t.faq.titolo}
|
|
|
|
|
</h2>
|
2026-05-12 18:43:00 +02:00
|
|
|
<p className="md:text-xl/relaxed lg:text-base/relaxed xl:text-xl/relaxed">
|
2025-08-28 18:27:07 +02:00
|
|
|
{t.faq.descrizione}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-08-04 17:45:44 +02:00
|
|
|
|
2026-05-12 18:43:00 +02:00
|
|
|
<div className="flex w-full flex-col gap-5">
|
|
|
|
|
{t.faq.domande.map((item) => (
|
|
|
|
|
<Accordion
|
|
|
|
|
className="relative w-full rounded-lg bg-secondary p-4 text-secondary-foreground"
|
|
|
|
|
collapsible
|
|
|
|
|
key={`accordion-${item.id}`}
|
|
|
|
|
//defaultValue="0"
|
|
|
|
|
type="single"
|
|
|
|
|
>
|
|
|
|
|
<div className="absolute -top-16" id={`faq-${item.id}`} />
|
|
|
|
|
<h3 className="font-semibold text-2xl">{item.label}</h3>
|
2026-05-13 15:42:19 +02:00
|
|
|
<hr className="border-primary" />
|
2026-05-12 18:43:00 +02:00
|
|
|
<div className="flex flex-col gap-1">
|
|
|
|
|
{item.qas.map((f, i) => (
|
|
|
|
|
<AccordionItem
|
|
|
|
|
className="border-primary border-b"
|
|
|
|
|
key={`accordion-item-${item.id}-${
|
|
|
|
|
// biome-ignore lint/suspicious/noArrayIndexKey: <ok>
|
|
|
|
|
i
|
|
|
|
|
}`}
|
|
|
|
|
value={i.toString()}
|
|
|
|
|
>
|
|
|
|
|
<AccordionTrigger className="cursor-pointer text-left [&>svg]:text-secondary-foreground">
|
|
|
|
|
{f.title}
|
|
|
|
|
</AccordionTrigger>
|
|
|
|
|
<AccordionContent>
|
|
|
|
|
<p className="leading-relaxed">{f.description}</p>
|
|
|
|
|
</AccordionContent>
|
|
|
|
|
</AccordionItem>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
</Accordion>
|
|
|
|
|
))}
|
2025-08-28 18:27:07 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|
|
|
|
|
);
|
2025-08-04 17:45:44 +02:00
|
|
|
};
|