/* ============================================================ DNA Health & Wellness — Multi-step booking flow + App shell ============================================================ */ const { useState: useStateApp, useEffect: useEffectApp } = React; /* -------------------- BookSheet (multi-step) -------------------- */ function BookSheet({ open, onClose, presetPillar, presetLocation }) { const STEPS = ['Pillar', 'Program', 'Location', 'When', 'Contact', 'Confirm']; const [step, setStep] = useStateApp(0); const [pillar, setPillar] = useStateApp(''); const [program, setProgram] = useStateApp(''); const [location, setLocation] = useStateApp(''); const [when, setWhen] = useStateApp(''); const [time, setTime] = useStateApp(''); const [contact, setContact] = useStateApp({ name: '', email: '', phone: '', message: '', preferred: 'WhatsApp' }); const [done, setDone] = useStateApp(false); useEffectApp(() => { if (open) { setStep(0); setPillar(presetPillar || ''); setLocation(presetLocation || ''); setProgram(''); setWhen(''); setTime(''); setContact({ name: '', email: '', phone: '', message: '', preferred: 'WhatsApp' }); setDone(false); } }, [open, presetPillar, presetLocation]); // jump past preset useEffectApp(() => { if (open && pillar && step === 0) setStep(1); }, [open, pillar]); if (!open) return null; const activePillar = PILLARS.find(p => p.name === pillar); const canNext = (() => { if (step === 0) return !!pillar; if (step === 1) return !!program; if (step === 2) return !!location; if (step === 3) return !!when && !!time; if (step === 4) return contact.name && contact.email && contact.phone; return true; })(); const submit = () => { setDone(true); }; const progress = ((step + 1) / STEPS.length) * 100; return (
{ if (e.target === e.currentTarget) onClose(); }}>
{!done ? ( <>
Step {String(step + 1).padStart(2, '0')} of {STEPS.length}
{STEPS[step]}
{step === 0 && ( <>

Where shall we start?

Pick the pillar closest to what you're after. You can move between them later.
{PILLARS.map(p => (
setPillar(p.name)}>
{p.num} · {p.name}
{p.tagline}
))}
)} {step === 1 && activePillar && ( <>

Which {activePillar.name.toLowerCase()} program?

Approximate — we'll refine in the consultation. Prices are typed from the current rate card; final figures confirmed by your doctor.
{activePillar.programs.map(pr => (
setProgram(pr.name)}>
{pr.name}
{pr.price}
))}
setProgram('Not sure yet')}>
Not sure yet
A doctor will guide you in a 30-min discovery call.
)} {step === 2 && ( <>

Which clinic suits you?

All branches share one medical record. Home-service is available for screenings and IV therapy in select postcodes.
{LOCATIONS.map(l => (
setLocation(l.name)}>
{l.name}
{l.address.split(',').slice(0, 2).join(',')}
))}
setLocation('Home service')}>
Home service
Concierge IV / screening at your address.
)} {step === 3 && ( <>

When works for you?

Indicative slots only — your doctor's PA will confirm by WhatsApp within two hours.
{['Today', 'Tomorrow', 'This week', 'Next week'].map(d => (
setWhen(d)}>
{d}
))}
{['Morning (08-12)', 'Afternoon (12-17)', 'Evening (17-21)'].map(t => (
setTime(t)}>
{t}
))}
)} {step === 4 && ( <>

How shall we reach you?

Minimal personal info — we don't ask for medical history here. That conversation belongs in clinic.
setContact({ ...contact, name: e.target.value })} placeholder="As it appears on Emirates ID"/>
setContact({ ...contact, email: e.target.value })} placeholder="you@example.com"/>
setContact({ ...contact, phone: e.target.value })} placeholder="+971 5_ ___ ____"/>