diff --git a/src/app/globals.css b/src/app/globals.css index 749f4a2..4722fb1 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -2458,6 +2458,14 @@ a { } } +.lead-form iframe { + display: block; + width: 100%; + min-height: 992px; + border: none; + border-radius: 0; +} + .contact-form { display: flex; flex-direction: column; diff --git a/src/components/content/contact-form.tsx b/src/components/content/contact-form.tsx deleted file mode 100644 index 054d82a..0000000 --- a/src/components/content/contact-form.tsx +++ /dev/null @@ -1,168 +0,0 @@ -"use client"; - -import { useActionState, useEffect, useRef, useState } from "react"; -import { sendContact, type ContactState } from "@/lib/contact-action"; -import type { Locale } from "@/i18n/config"; -import type { UI } from "@/i18n/ui"; -import { CONTACT_EMAIL, serviceNav } from "@/lib/routes"; -import HumanCheck, { type Solution } from "./human-check"; - -const initial: ContactState = { status: "idle" }; - -export default function ContactForm({ - locale, - t, - services, -}: { - locale: Locale; - t: UI["form"]; - services: UI["services"]; -}) { - const [state, action, pending] = useActionState(sendContact, initial); - const startedRef = useRef(null); - const [solution, setSolution] = useState(null); - const [needsCheck, setNeedsCheck] = useState(false); - const [seenState, setSeenState] = useState(state); - - // Interests go to the team in English, whatever language the visitor reads the site in. - const interests = [ - ...serviceNav.map((s) => ({ value: s.name, label: services[s.slug] })), - { value: "Not sure yet", label: t.notSure }, - ]; - - // A solution is single-use: once the server has checked it, the visitor ticks the box again. - if (seenState !== state) { - setSeenState(state); - if (state.status === "error" && state.error !== "details") setSolution(null); - } - - // When the visitor started filling the form; the server rejects instant (bot) submissions. - useEffect(() => { - if (startedRef.current && !startedRef.current.value) startedRef.current.value = String(Date.now()); - }, []); - - if (state.status === "sent") { - return ( -
- -

{t.sentTitle}

-

{t.sentBody}

-
- ); - } - - const values = state.status === "error" ? state.values : undefined; - const error = needsCheck && !solution ? "human" : state.status === "error" ? state.error : null; - - return ( -
{ - if (!solution) { - e.preventDefault(); - setNeedsCheck(true); - } - }} - > - -
- - -
-
- - -
- {/* Honeypot for bots — hidden from people and assistive tech. */} - - -
- {t.interests} -
- {interests.map((i) => ( - - ))} -
-
-