// Lead-capture multi-step form — Register Interest / Brochure / Private Viewing const { useState } = React; function RegisterForm({ project, accent }) { const [mode, setMode] = useState("interest"); // interest | brochure | viewing const [step, setStep] = useState(1); const [done, setDone] = useState(false); const [data, setData] = useState({ title:"Mr", firstName:"", lastName:"", email:"", phoneCode:"+971", phone:"", nationality:"", residency:"United Arab Emirates", budget:"USD 5–10M", typology:"Whole floor", timeline:"Within 3 months", referral:"Broker", brokerName:"", message:"", consent:false, privacy:false, viewingDate:"", viewingTime:"11:00", }); const [refNum] = useState(()=> "OMN-"+Math.random().toString(36).slice(2,8).toUpperCase()); const set = (k,v)=> setData(d => ({ ...d, [k]:v })); const modes = [ { id:"interest", label:"Register interest" }, { id:"brochure", label:"Download brochure" }, { id:"viewing", label:"Private viewing" }, ]; const totalSteps = mode === "viewing" ? 3 : 2; if (done) { return (

Thank you, {data.firstName || "—"}.

{mode === "brochure" && "A senior representative will share The Alba brochure within one business day via the email you provided."} {mode === "interest" && "A senior representative will be in contact within one business day. Until then, the brochure has been queued to your email."} {mode === "viewing" && `Your private viewing is provisionally requested for ${data.viewingDate || "—"} at ${data.viewingTime}. We will confirm by ${data.email || "—"}.`}

Reference · {refNum}

); } const canStep1 = data.firstName && data.lastName && data.email && data.phone; const canStep2 = mode === "viewing" ? (data.viewingDate) : (data.consent && data.privacy); const canSubmit = data.consent && data.privacy; return (
{modes.map(m => ( ))}
{Array.from({length:totalSteps}).map((_,i)=>( ))}
{step === 1 && (
set("nationality", e.target.value)} placeholder="e.g. British" />
set("firstName", e.target.value)} placeholder="" />
set("lastName", e.target.value)} placeholder="" />
set("email", e.target.value)} placeholder="" />
set("phone", e.target.value)} placeholder="" />
)} {step === 2 && mode !== "viewing" && (
{data.referral === "Broker" && (
set("brokerName", e.target.value)} />
)}