// Contact page with working form + validation const ContactPage = ({ showToast }) => { useLucide(); const [form, setForm] = React.useState({ name: '', email: '', phone: '', intent: 'buying', message: '', contactBy: 'email', }); const [err, setErr] = React.useState({}); const [sent, setSent] = React.useState(false); const submit = (e) => { e.preventDefault(); const next = {}; if (!form.name.trim()) next.name = 'Please tell me your name'; if (!form.email.includes('@') || form.email.length < 5) next.email = 'A real email please'; if (!form.message.trim() || form.message.length < 10) next.message = 'A bit more context helps — even one line'; setErr(next); if (Object.keys(next).length === 0) { setSent(true); showToast("Sent — I'll reply within 24 hours. Thank you."); setForm({ name: '', email: '', phone: '', intent: 'buying', message: '', contactBy: 'email' }); setTimeout(() => setSent(false), 6000); } }; return (
Contact

Let's start a conversation.

The form goes straight to my inbox. For anything urgent, the phone is faster — I usually answer between 8am and 8pm.

{/* Form */}
{sent ? (

Message sent.

I'll get back to you within 24 hours.

) : (
setForm({ ...form, name: e.target.value })} placeholder="Full name" /> {err.name &&
{err.name}
}
setForm({ ...form, phone: e.target.value })} placeholder="(604) 000-0000" />
setForm({ ...form, email: e.target.value })} placeholder="you@example.com" /> {err.email &&
{err.email}
}
{[ { id: 'buying', label: 'Buying' }, { id: 'selling', label: 'Selling' }, { id: 'investing', label: 'Investing' }, { id: 'rental', label: 'Renting / managing' }, { id: 'valuation', label: 'Home valuation' }, { id: 'other', label: 'Just curious' }, ].map(o => ( ))}