diff --git a/src/app/contact/page.tsx b/src/app/contact/page.tsx new file mode 100644 index 0000000..c835beb --- /dev/null +++ b/src/app/contact/page.tsx @@ -0,0 +1,194 @@ +'use client'; + +import { useState } from 'react'; +import { useLanguage } from '@/lib/i18n'; + +const gold = '#E8A849'; +const navy = '#010D1E'; +const cream = '#f5f0e8'; + +const copy = { + en: { + title: 'Contact Us', + subtitle: 'Get in touch with us', + phone: 'Phone', + email: 'Email', + whatsapp: 'WhatsApp', + location: 'Location', + address: 'Otavalo, Imbabura, Ecuador', + send_message: 'Send us a message', + form_name: 'Your Name', + form_email: 'Your Email', + form_message: 'Message', + form_submit: 'Send Message', + form_sending: 'Sending...', + form_success: 'Message sent successfully!', + form_error: 'Failed to send message. Please try again.', + }, + es: { + title: 'Contáctenos', + subtitle: 'Póngase en contacto con nosotros', + phone: 'Teléfono', + email: 'Correo', + whatsapp: 'WhatsApp', + location: 'Ubicación', + address: 'Otavalo, Imbabura, Ecuador', + send_message: 'Envíenos un mensaje', + form_name: 'Su Nombre', + form_email: 'Su Correo', + form_message: 'Mensaje', + form_submit: 'Enviar Mensaje', + form_sending: 'Enviando...', + form_success: '¡Mensaje enviado exitosamente!', + form_error: 'Error al enviar el mensaje. Intente de nuevo.', + }, +}; + +export default function ContactPage() { + const language = useLanguage(); + const t = copy[language]; + const [form, setForm] = useState({ name: '', email: '', message: '' }); + const [status, setStatus] = useState<'idle' | 'sending' | 'success' | 'error'>('idle'); + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + setStatus('sending'); + try { + const res = await fetch('/api/contact', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(form), + }); + if (res.ok) { + setStatus('success'); + setForm({ name: '', email: '', message: '' }); + } else { + setStatus('error'); + } + } catch { + setStatus('error'); + } + }; + + return ( +
+
+

+ {t.title} +

+

+ {t.subtitle} +

+ +
+ {/* Phone */} +
+
📞
+
{t.phone}
+
+593 99 XXX XXXX
+
+ + {/* Email */} +
+
✉️
+
{t.email}
+
info@lahuasca.com
+
+ + {/* WhatsApp */} +
+
💬
+
{t.whatsapp}
+
+593 99 XXX XXXX
+
+ + {/* Location */} +
+
📍
+
{t.location}
+
{t.address}
+
+
+ + {/* Contact Form */} +
+

+ {t.send_message} +

+
+ setForm({ ...form, name: e.target.value })} + required + style={{ + padding: '0.875rem 1rem', + background: 'rgba(245,240,232,0.08)', + border: '1px solid rgba(245,240,232,0.2)', + borderRadius: '8px', + color: cream, + fontSize: '15px', + }} + /> + setForm({ ...form, email: e.target.value })} + required + style={{ + padding: '0.875rem 1rem', + background: 'rgba(245,240,232,0.08)', + border: '1px solid rgba(245,240,232,0.2)', + borderRadius: '8px', + color: cream, + fontSize: '15px', + }} + /> +