// ContactForm.jsx — formulario de contacto con envío via Formspree function ContactForm() { const [form, setForm] = React.useState({ name: '', email: '', message: '' }); const [submitted, setSubmitted] = React.useState(false); const [sending, setSending] = React.useState(false); const [error, setError] = React.useState(''); const set = (field) => (e) => { setForm((f) => ({ ...f, [field]: e.target.value })); if (error) setError(''); }; const onSubmit = async (e) => { e.preventDefault(); if (!form.name.trim()) { setError('Escribe tu nombre.'); return; } if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email)) { setError('Revisa el email — algo no cuadra.'); return; } if (!form.message.trim()) { setError('Escribe un mensaje.'); return; } setSending(true); setError(''); try { await window.supabaseApi.submitContact({ name: form.name, email: form.email, message: form.message }); setSubmitted(true); } catch (err) { setError('No se pudo enviar el mensaje. Inténtalo de nuevo.'); } finally { setSending(false); } }; return (
Contacto

¿Hablamos?

Cuéntame qué necesitas y te responderé lo antes posible.

{submitted ? (
Mensaje enviado. Te respondo pronto.
) : (