"use client"; import { useState } from "react"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Textarea } from "@/components/ui/textarea"; import { DataConsentField } from "@/components/forms/DataConsentField"; import { dataConsent } from "@/content/consent"; export function PartnershipInquiryForm() { const [status, setStatus] = useState<"idle" | "loading" | "success" | "error">("idle"); const [error, setError] = useState(""); const [consent, setConsent] = useState(false); async function onSubmit(e: React.FormEvent) { e.preventDefault(); if (!consent) { setError(dataConsent.errorMessage); return; } setStatus("loading"); setError(""); const form = e.currentTarget; const data = new FormData(form); try { const res = await fetch("/api/inquiry", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ intent: "partnership", firstName: data.get("firstName"), lastName: data.get("lastName"), email: data.get("email"), company: data.get("company"), message: data.get("message") || undefined, consent: true, }), }); const json = await res.json(); if (!res.ok || !json.ok) { throw new Error(json.error || "Something went wrong"); } setStatus("success"); form.reset(); setConsent(false); } catch (err) { setStatus("error"); setError(err instanceof Error ? err.message : "Failed to send"); } } return (

Request Partnership Information