// modals.jsx — Register Interest (multi-step), Brochure Gate, Private Viewing. // Loaded after sections.jsx. const { useState: useState_m, useEffect: useEffect_m, useMemo: useMemo_m } = React; // Modal shell ─────────────────────────────────────────────────────────────── function Modal({ open, onClose, children, size }) { useEffect_m(() => { if (!open) return; const onKey = (e) => e.key === 'Escape' && onClose(); document.addEventListener('keydown', onKey); const prev = document.body.style.overflow; document.body.style.overflow = 'hidden'; return () => { document.removeEventListener('keydown', onKey); document.body.style.overflow = prev; }; }, [open, onClose]); if (!open) return null; return (
e.stopPropagation()}> {children}
); } function ModalHead({ eyebrow, title, sub, onClose }) { return (
{eyebrow}

{title}

{sub &&

{sub}

}
); } function SuccessScreen({ title, body, cta, onClose }) { return (
Confirmed

{title}

{body}

{cta && }
); } // Register Interest — multi-step ──────────────────────────────────────────── function RegisterModal({ open, onClose, project, copy }) { const F = copy.forms.register; const [step, setStep] = useState_m(0); const [done, setDone] = useState_m(false); const [form, setForm] = useState_m({ fname: '', lname: '', email: '', phone: '', country: '', lang: copy._lang === 'en' ? 'English' : (copy._lang === 'ar' ? 'العربية' : copy._lang === 'ru' ? 'Русский' : '中文'), intent: '', timing: '', budget: '', rooms: '', contact: '', notes: '', project: project.name, }); useEffect_m(() => { if (open) { setStep(0); setDone(false); } }, [open]); if (!open) return null; const u = (k) => (e) => setForm({ ...form, [k]: e.target.value }); const sel = (k, val) => setForm({ ...form, [k]: val }); const s1Valid = form.fname && form.lname && form.email; const s2Valid = form.intent && form.timing; const submit = () => setDone(true); return ( {done ? (
) : ( <>
01 · {F.s1} 02 · {F.s2} 03 · {F.s3}
{step === 0 && ( <>
)} {step === 1 && ( <> sel('intent', v)} /> sel('timing', v)} /> sel('budget', v)} /> )} {step === 2 && ( <> sel('rooms', v)} /> sel('contact', v)} />