// FAQ, Contact, Footer function FAQ({ t }) { const [open, setOpen] = React.useState(0); return ( [05] — {t.faq.eyebrow} {t.faq.title} {t.faq.items.map((it, i) => ( setOpen(open === i ? -1 : i)}> 0{i + 1} {it.q} + {it.a} ))} ); } function Contact({ t }) { const [status, setStatus] = React.useState("idle"); // idle | sending | sent | error const [topic, setTopic] = React.useState(0); const f = t.contact.form; const FORMSPREE_ID = "meenorjd"; const handle = (e) => { e.preventDefault(); if (status === "sending") return; setStatus("sending"); const data = new FormData(e.target); data.set("Sujet", f.topics[topic]); fetch("https://formspree.io/f/" + FORMSPREE_ID, { method: "POST", body: data, headers: { Accept: "application/json" }, }) .then((res) => { if (res.ok) { setStatus("sent"); e.target.reset(); setTopic(0); } else { setStatus("error"); } }) .catch(() => setStatus("error")); }; return ( [06] — {t.contact.eyebrow} {t.contact.title} {t.contact.sub} {f.name} {f.org} {f.email} {f.topic} {f.topics.map((o, i) => ( setTopic(i)} > {o} ))} {f.msg} {status === "sent" && "✓ " + f.sent} {status === "error" && "⚠ " + f.err} {status === "sending" ? "…" : f.send + " →"} ADDR {t.contact.infos.addr} {/* TEL — à compléter */} MAIL {t.contact.infos.mail} Email {t.contact.infos.mail} → ); } function Footer({ t }) { return ( ); } Object.assign(window, { FAQ, Contact, Footer });
{t.contact.sub}