// Interactive Book-a-Tour multi-step modal function TourModal({ open, onClose, programmeBias }) { const [step, setStep] = React.useState(0); const [data, setData] = React.useState({ childAge: '', programme: programmeBias || '', visitType: 'in-person', date: '', time: '', parentName: '', email: '', phone: '', notes: '', }); const [done, setDone] = React.useState(false); React.useEffect(() => { if (open) { setStep(0); setDone(false); if (programmeBias) setData(d => ({ ...d, programme: programmeBias })); } }, [open, programmeBias]); if (!open) return null; const update = (k, v) => setData(d => ({ ...d, [k]: v })); const ageBands = [ { id: 'infants', label: 'Infants & Toddlers', sub: '9 months – 3 yrs' }, { id: 'preKG', label: 'Pre-KG', sub: '3 – 4 yrs' }, { id: 'kg1', label: 'KG1', sub: '4 – 5 yrs' }, { id: 'kg2', label: 'KG2', sub: '5 – 6 yrs' }, ]; const dates = (() => { const out = []; const now = new Date(); for (let i = 1; i <= 8; i++) { const d = new Date(now); d.setDate(now.getDate() + i); if (d.getDay() === 5 || d.getDay() === 6) continue; out.push(d); } // skip weekends (Fri/Sat UAE) return out; })(); const fmtDate = (d) => d.toLocaleDateString('en-GB', { weekday: 'short', day: 'numeric', month: 'short' }); const dateKey = (d) => d.toISOString().slice(0,10); const times = ['09:30', '10:30', '11:30', '13:30', '15:00']; const canNext = () => { if (step === 0) return data.programme; if (step === 1) return data.date && data.time; if (step === 2) return data.parentName && data.email && data.phone; return true; }; const next = () => { if (step < 2) { setStep(step + 1); } else { setDone(true); } }; const close = () => { onClose(); }; return (
e.stopPropagation()} style={{ position: 'relative' }}>
{done ? (

You're booked in — sort of.

This is a design prototype, so nothing was sent. In production this would email admissions@ideaelc.ae and confirm to {data.email || 'you'}.

{data.parentName} · {ageBands.find(b => b.id === data.programme)?.label}
{data.date && new Date(data.date).toLocaleDateString('en-GB', { weekday: 'long', day: 'numeric', month: 'long' })} at {data.time}
Confirm on WhatsApp
) : ( <>
{[0,1,2].map(i => )}
Step {step + 1} of 3
{step === 0 && (

Tell us about your child

We'll match you with the right age group on the day.

{ageBands.map(b => ( ))}
)} {step === 1 && (

Pick a day & time

Tours run mid-morning when classrooms are most active.

{dates.map(d => ( ))}
Times available
{times.map(t => ( ))}
)} {step === 2 && (

Your details

We'll send your confirmation here.

update('parentName', e.target.value)} placeholder="Your full name" />
update('email', e.target.value)} placeholder="you@example.com" />
update('phone', e.target.value)} placeholder="+971 …" />