// Object 1 — Lead section + register-interest form + brochure modal.
function Lead({ t, onSubmit, onBrochure, onViewing }) {
const [form, setForm] = React.useState({
first: '', last: '', email: '', phone: '',
interest: '', market: '', consent: false,
});
const [errors, setErrors] = React.useState({});
const [submitted, setSubmitted] = React.useState(false);
function update(k, v) { setForm(f => ({ ...f, [k]: v })); setErrors(e => ({ ...e, [k]: null })); }
function validate() {
const e = {};
if (!form.first.trim()) e.first = '✕';
if (!form.last.trim()) e.last = '✕';
if (!/^\S+@\S+\.\S+$/.test(form.email)) e.email = '✕';
if (!/^[\+0-9\s\-()]{7,}$/.test(form.phone)) e.phone = '✕';
if (!form.interest) e.interest = '✕';
if (!form.market) e.market = '✕';
if (!form.consent) e.consent = '✕';
return e;
}
function handleSubmit(ev) {
ev.preventDefault();
const e = validate();
setErrors(e);
if (Object.keys(e).length === 0) {
setSubmitted(true);
onSubmit && onSubmit(form);
}
}
const ctaActions = [
() => document.getElementById('register-form')?.scrollIntoView({ behavior: 'smooth', block: 'center' }),
() => onBrochure(),
() => onViewing(),
() => window.open('https://wa.me/971523810148', '_blank'),
];
return (
{t.lead.successBody} project=w1nner · locale={t.dir === 'rtl' ? 'ar' : 'en'} · src=microsite{t.lead.successTitle}
{t.brochure.sub}
> ) : ({t.dir === 'rtl' ? 'يتم إرسال الكتيب إلى بريدك خلال دقائق.' : 'The brochure will arrive in your inbox within a few minutes.'}
{t.dir === 'rtl' ? 'صالة العرض في وسط مدينة دبي. عند الطلب.' : 'Sales gallery, Downtown Dubai. By appointment.'}
> ) : ({t.dir === 'rtl' ? 'سنؤكد الموعد خلال يوم عمل.' : 'We will confirm the appointment within one business day.'}