// app.jsx — Cala Del Mar microsite root const { useState: useStateA, useEffect: useEffectA, useRef: useRefA } = React; // ─── Register interest form ──────────────────────────────────────────────── function RegisterSection({ project, contact }) { const [form, setForm] = useStateA({ name: "", email: "", phone: "", country: "", residency: "Investor", timing: "Within 3 months", consent: false, }); const [errors, setErrors] = useStateA({}); const [sent, setSent] = useStateA(false); const [refNo] = useStateA(() => "EP-" + Math.random().toString(36).slice(2, 7).toUpperCase()); const set = (k) => (e) => { const v = e.target.type === "checkbox" ? e.target.checked : e.target.value; setForm((f) => ({ ...f, [k]: v })); if (errors[k]) setErrors((er) => { const n = { ...er }; delete n[k]; return n; }); }; const submit = (e) => { e.preventDefault(); const er = {}; if (!form.name.trim()) er.name = "Required"; if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(form.email)) er.email = "Valid email required"; if (!form.phone.trim() || form.phone.replace(/\D/g, "").length < 7) er.phone = "Phone required"; if (!form.consent) er.consent = "Required"; setErrors(er); if (Object.keys(er).length) return; // Simulated submission — would post to CRM webhook in production setTimeout(() => setSent(true), 320); }; return (
§ 08 · Register Interest

A private viewing,
at your pace.

Register your details to receive the full Cala Del Mar brochure, current floor-plan availability, and an invitation to a private viewing at the Burlington Tower presentation suite or by virtual walkthrough.

Phone{contact.phone}
Toll-free (UAE){contact.tollfree}
WhatsApp{contact.whatsapp}
Email{contact.email}
{!sent ? (
{errors.name && {errors.name}}
{errors.email && {errors.email}}
{errors.phone && {errors.phone}}

Ref · {refNo} · Brochure will be sent to the email above

) : (
Registration received

Thank you, {form.name.split(" ")[0] || "—"}.

Your registration {refNo} has been recorded. The Cala Del Mar brochure is on its way to {form.email}. A senior consultant will be in touch within one working day to confirm a private viewing.

Prefer to talk now? WhatsApp {contact.whatsapp} or call {contact.phone}.

)}
); } // ─── Footer ──────────────────────────────────────────────────────────────── function Footer({ contact, socials }) { return ( ); } // ─── WhatsApp FAB ────────────────────────────────────────────────────────── function WhatsAppFab({ number }) { const href = `https://wa.me/${number.replace(/\D/g, "")}`; return ( ); } // ─── App root ────────────────────────────────────────────────────────────── function App() { const D = window.DATA; const [t, setTweak] = useTweaks(window.CALA_DEFAULTS); const [locale, setLocale] = useStateA("EN"); const [lbxIndex, setLbxIndex] = useStateA(null); // Apply tweaks to root via data-attrs useEffectA(() => { document.documentElement.setAttribute("data-palette", t.palette); document.documentElement.setAttribute("data-type", t.typePairing); document.documentElement.setAttribute("data-density", t.density); }, [t.palette, t.typePairing, t.density]); const scrollToRegister = () => { const el = document.getElementById("register"); if (el) window.scrollTo({ top: el.offsetTop - 40, behavior: "smooth" }); }; const fakeBrochure = () => { alert("In production: triggers a gated brochure download (email-gate → PDF).\n\nFor this prototype, please use the Register Interest form below."); scrollToRegister(); }; return ( <>