// Contact / Book — multi-step booking funnel + branch contact panel. function DSCContactPage({ navigate, prefill }) { const d = window.DSC_DATA; const [step, setStep] = useState(0); const [data, setData] = useState({ treatment: prefill?.treatment || "", branch: prefill?.branch || "burjuman", dentist: prefill?.dentist || "", name: "", phone: "", email: "", date: "", note: "", }); const [errors, setErrors] = useState({}); const [submitted, setSubmitted] = useState(false); const steps = [ { id: "treatment", label: "Treatment" }, { id: "branch", label: "Branch" }, { id: "contact", label: "Your details" }, { id: "confirm", label: "Confirm" }, ]; // Skip directly to confirm when all required already prefilled? Keep multi-step for the demo. function setField(k, v) { setData((p) => ({ ...p, [k]: v })); } function validateStep() { const e = {}; if (step === 0 && !data.treatment) e.treatment = "Pick a treatment to continue."; if (step === 1 && !data.branch) e.branch = "Pick a branch."; if (step === 2) { if (!data.name.trim()) e.name = "Your name, please."; if (!data.phone.trim() || data.phone.replace(/\D/g, "").length < 7) e.phone = "A valid phone helps us confirm."; } setErrors(e); return Object.keys(e).length === 0; } function next() { if (validateStep()) setStep((s) => Math.min(s + 1, steps.length - 1)); } function prev() { setStep((s) => Math.max(0, s - 1)); setErrors({}); } function submit() { if (!validateStep()) return; // Simulated — would POST to Formspree/Netlify in production setSubmitted(true); } const treatment = d.treatments.find((t) => t.slug === data.treatment); const branch = d.branches.find((b) => b.id === data.branch); const dentist = d.dentists.find((x) => x.slug === data.dentist); return (
Tell us what you'd like to discuss, which branch suits you, and how to reach you. Our front desk will confirm within one business day. For something urgent, use WhatsApp.
{errors.treatment}
}Not sure? Pick "General & Preventive" and we will triage at the first visit.
Submitting will POST to Formspree / Netlify Forms in production. This prototype simulates the submission only.
Our front desk at {branch?.brand} will confirm your {treatment?.name} consultation within one business day, on {data.phone}.