// 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 [sending, setSending] = React.useState(false); const submit = async (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) return; setSending(true); const ok = await window.sendLead({ subject: `New contact enquiry (${form.intent}) — ${form.name}`, replyTo: form.email, fields: { Name: form.name, Email: form.email, Phone: form.phone || '—', Interested_in: form.intent, Preferred_contact: form.contactBy, Message: form.message, }, }); setSending(false); if (ok) { 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); } else { showToast(`Couldn't send just now — please email me at ${SITE_DATA.agent.email} or call ${SITE_DATA.agent.phone}.`); } }; return (
The form goes straight to my inbox. For anything urgent, the phone is faster — I usually answer between 8am and 8pm.
I'll get back to you within 24 hours.