/* global React, VNav, VFooter, Social, useReveal */ // contact.jsx — Página de contacto FersaMedia (agenda + formulario) const { useState } = React; // ⚙️ Sustituye por tu URL real de "Programación de citas" de Google Calendar. // Panel de Google Calendar → Crear → Programación de citas → Compartir → Copiar enlace. const CAL_URL = 'https://calendar.google.com/calendar/appointments/schedules/PLACEHOLDER'; const CAL_READY = CAL_URL.includes('/schedules/') && !CAL_URL.includes('PLACEHOLDER'); const EMAIL = 'hola@fersamedia.com'; const WHATSAPP = '34600000000'; // ⚙️ número en formato internacional, sin + ni espacios const HOME_URL = 'index.html'; const CONTACT_NAV = [[HOME_URL, 'Inicio'], [HOME_URL + '#servicios', 'Servicios'], [HOME_URL + '#sectores', 'Verticales']]; const IconCal = () => ; const IconForm = () => ; const IconMail = () => ; const IconWa = () => ; /* ---------- Agenda (Google Calendar) ---------- */ function AgendaPanel() { if (CAL_READY) { return ; } return (

Reserva tu llamada de 15 minutos

Elige el hueco que mejor te venga y hablamos de tu negocio, sin compromiso. Diagnóstico gratuito.

Ver horarios disponibles

Se abrirá tu agenda de Google Calendar en una pestaña nueva.

); } /* ---------- Formulario (PHPMailer) ---------- */ function FormPanel() { const [status, setStatus] = useState('idle'); // idle | sending | ok | err const [msg, setMsg] = useState(''); async function onSubmit(e) { e.preventDefault(); const form = e.currentTarget; if (form.website && form.website.value) return; // honeypot setStatus('sending'); try { const res = await fetch('contact.php', { method: 'POST', body: new FormData(form) }); const data = await res.json().catch(() => ({})); if (res.ok && data.ok) { setStatus('ok'); setMsg('¡Gracias! Hemos recibido tu mensaje y te responderemos en menos de 24 h.'); form.reset(); } else { setStatus('err'); setMsg((data && data.error) || 'No se pudo enviar el mensaje. Inténtalo de nuevo o escríbenos por WhatsApp.'); } } catch (err) { setStatus('err'); setMsg('Este formulario necesita el backend PHP (contact.php con PHPMailer) para enviarse. Súbelo a tu servidor para activarlo.'); } } return (
{status === 'ok' ? 'Mensaje enviado' : 'Nota'}
{msg}

Al enviar aceptas que te contactemos sobre tu consulta. Sin spam, sin compromiso.

); } /* ---------- Página ---------- */ function ContactPage() { useReveal(); const [tab, setTab] = useState('agenda'); return (

Contacto

Hablemos de tu crecimiento.

Reserva una llamada de 15 minutos o déjanos tus datos. Te respondemos en menos de 24 horas — sin permanencias y con diagnóstico gratuito.

{tab === 'agenda' ? : }
); } Object.assign(window, { ContactPage });