// 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 (
This is a design prototype, so nothing was sent. In production this would email admissions@ideaelc.ae and confirm to {data.email || 'you'}.
We'll match you with the right age group on the day.
Tours run mid-morning when classrooms are most active.
We'll send your confirmation here.