"use client"; export const dynamic = "force-dynamic"; export const runtime = "nodejs"; import { Suspense } from "react"; import { useState } from "react"; import { useRouter, useSearchParams } from "next/navigation"; import { motion, AnimatePresence } from "framer-motion"; import { toast } from "sonner"; export default function ContactPage() { return ( Loading...}> ); } function RequestForm() { const router = useRouter(); const searchParams = useSearchParams(); const prefillType = searchParams.get("type") as RequestType | null; const [step, setStep] = useState(1); const [loading, setLoading] = useState(false); const [form, setForm] = useState({ type: prefillType || "", name: "", email: "", domain: "", company: "", message: "", hosting: "", concern: "", }); type RequestType = | "audit" | "consultation" | "support" | "tool" | "partnership"; const requestTypes: { id: RequestType; label: string; desc: string; icon: string }[] = [ { id: "audit", label: "Free Audit", desc: "Request a free website, DNS or performance check.", icon: "🧠", }, { id: "consultation", label: "Consultation / Quote", desc: "Discuss a project, hosting setup, or optimization.", icon: "⚙️", }, { id: "support", label: "Technical Support", desc: "Report an issue or request hands-on help.", icon: "🛠️", }, { id: "tool", label: "Tool Follow-Up", desc: "Continue from one of our free tools or reports.", icon: "📊", }, { id: "partnership", label: "Partnership / Collaboration", desc: "Discuss a potential collaboration or integration.", icon: "🤝", }, ]; const handleChange = ( e: React.ChangeEvent ) => { const { name, value } = e.target; setForm((f) => ({ ...f, [name]: value })); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); try { const res = await fetch("/api/contact", { method: "POST", headers: { "Content-Type": "application/json", "x-secret-token": process.env.NEXT_PUBLIC_FORM_SECRET || "", }, body: JSON.stringify(form), }); if (!res.ok) throw new Error("Submission failed"); toast.success("Request submitted successfully!"); router.push("/contact/success"); } catch (err) { console.error(err); toast.error("Something went wrong. Please try again."); } finally { setLoading(false); } }; return (

Start a Request

Choose what you’d like to do — audits, consultations, or support. We’ll guide you through the right steps and get back within one business day.

{step === 1 && (

What kind of request do you have?

{requestTypes.map((t) => ( ))}
)} {step === 2 && (

{requestTypes.find((t) => t.id === form.type)?.label}

{(form.type === "audit" || form.type === "consultation") && ( <>
)}