// Contact page const ContactPage = ({ onNav }) => { const [form, setForm] = React.useState({ name: '', email: '', phone: '', message: '' }); const [sent, setSent] = React.useState(false); const [sending, setSending] = React.useState(false); const [sendError, setSendError] = React.useState(''); React.useEffect(() => { if (window.lucide) lucide.createIcons(); }); const submitContact = async (e) => { e.preventDefault(); setSendError(''); setSending(true); try { const res = await fetch('/wp-json/soul/v1/contact', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(form), }); const data = await res.json().catch(() => ({})); if (!res.ok || data.ok === false) { setSendError(data?.message || 'Submission failed. Please try again.'); setSending(false); return; } setSent(true); } catch (err) { setSendError('Network error. Please try again.'); } finally { setSending(false); } }; return (