// 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 (
Book a consultation 45 min · no commitment · written quote

Four steps to a chair on the 21st floor.

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.

{/* Steps */} {!submitted && (
{steps.map((s, i) => (
i ? "done" : ""}`}> {step > i ? "✓" : i + 1} {s.label}
))}
)} {/* Step body */} {!submitted && step === 0 && (

What would you like to discuss?

{d.treatments.map((t) => ( ))}
{errors.treatment &&

{errors.treatment}

}

Not sure? Pick "General & Preventive" and we will triage at the first visit.

)} {!submitted && step === 1 && (

Which branch suits you?

{d.branches.map((b) => ( ))}
)} {!submitted && step === 2 && (
setField("name", e.target.value)} /> {errors.name && {errors.name}}
setField("phone", e.target.value)} /> {errors.phone && {errors.phone}}
setField("email", e.target.value)} />
setField("date", e.target.value)} />