diff --git a/app/macon/MaconClient.tsx b/app/macon/MaconClient.tsx index d7a2846..02dcb0c 100644 --- a/app/macon/MaconClient.tsx +++ b/app/macon/MaconClient.tsx @@ -5,20 +5,22 @@ import MagicReveal from "@/components/ui/MagicReveal"; import Button from "@/components/ui/Button"; interface MaconClientProps { - type?: "slider" | "form" | "cert"; - certName?: string; + type?: "slider" | "form" | "faq" | "floating"; avantLabel?: string; apresLabel?: string; avantImage?: string; apresImage?: string; + faqs?: { q: string; a: string }[]; } -export default function MaconClient({ type, certName, avantLabel, apresLabel, avantImage, apresImage }: MaconClientProps) { - // Cert badge with popup - if (!type || type === "cert") { - return ; - } - +export default function MaconClient({ + type, + avantLabel, + apresLabel, + avantImage, + apresImage, + faqs, +}: MaconClientProps) { if (type === "slider") { return ( ; } + if (type === "faq") { + return ; + } + + if (type === "floating") { + return ; + } + return null; } -function CertBadge({ name }: { name: string }) { - const [open, setOpen] = useState(false); - - const infos: Record = { - "D\u00e9cennale": "La garantie d\u00e9cennale couvre tous les dommages compromettant la solidit\u00e9 de l\u2019ouvrage pendant 10 ans apr\u00e8s la r\u00e9ception des travaux.", - "Qualibat": "Qualibat est l\u2019organisme de r\u00e9f\u00e9rence pour la qualification des entreprises du b\u00e2timent. Gage de comp\u00e9tence et de s\u00e9rieux.", - "RGE": "Le label RGE (Reconnu Garant de l\u2019Environnement) vous permet de b\u00e9n\u00e9ficier des aides de l\u2019\u00c9tat : MaPrimeR\u00e9nov\u2019, CEE, \u00e9co-PTZ.", - }; +/* ============================================================ + FAQ ACCORDION + ============================================================ */ +function FaqAccordion({ faqs }: { faqs: { q: string; a: string }[] }) { + const [openIdx, setOpenIdx] = useState(null); return ( - <> - - - {/* Popup */} - {open && ( -
setOpen(false)}> -
e.stopPropagation()}> -
-
- - - -
-

{name}

-
-

- {infos[name] || "Certification professionnelle v\u00e9rifi\u00e9e."} -

+
+ {faqs.map((faq, i) => { + const isOpen = openIdx === i; + return ( +
+ {isOpen && ( +
+

{faq.a}

+
+ )}
-
- )} - + ); + })} +
); } +/* ============================================================ + SMART DEVIS FORM + ============================================================ */ function DevisForm() { - const [step, setStep] = useState<"type" | "details" | "urgence">("type"); + const [step, setStep] = useState<"type" | "details">("type"); const [projectType, setProjectType] = useState(""); - if (step === "urgence") { - return ( -
-
- - - -
-

Urgence détectée !

-

Pour une intervention rapide, appelez directement le patron :

- - - - - APPELER LE PATRON - -

Disponible 7j/7 pour les urgences

- -
- ); - } - if (step === "details") { return (
2/2 -

Détails du projet

+

Vos coordonnées

-

Type : {projectType}

+

+ Projet : {projectType} +

- - + +
- - + +
- - + +
- - + +