/* global React, ReactDOM, COPY */ const { useState, useEffect, useRef } = React; const INNER_LINKS = { es: [ { href: "/", idx: "01", label: "Inicio" }, { href: "/nosotros.html", idx: "02", label: "Nosotros" }, { href: "/soluciones.html", idx: "03", label: "Soluciones" }, { href: "/desarrollos.html", idx: "04", label: "Desarrollos" }, { href: "/contacto.html", idx: "05", label: "Contacto" }, ], en: [ { href: "/", idx: "01", label: "Home" }, { href: "/nosotros.html", idx: "02", label: "About" }, { href: "/soluciones.html", idx: "03", label: "Solutions" }, { href: "/desarrollos.html", idx: "04", label: "Lab" }, { href: "/contacto.html", idx: "05", label: "Contact" }, ], }; function ContactHero({ p }) { return (
{p.tag}

{p.title1}
{p.title2}

); } function ContactLeft({ p }) { return (

{p.intro}

{p.do.title}
{p.dont.title}
{p.expect.title}
    {p.expect.steps.map((s, i) =>
  1. {s}
  2. )}
{p.contact.map((c, i) => (
{c.label} {c.value}
))}
); } function ContactForm({ p }) { const [status, setStatus] = useState(null); const [msg, setMsg] = useState(""); const formRef = useRef(null); function handleSubmit(e) { e.preventDefault(); if (status === "sending") return; setStatus("sending"); setMsg(""); fetch("send_email.php", { method: "POST", body: new FormData(formRef.current) }) .then(r => r.json()) .then(res => { setMsg(res.message); if (res.status === "success") { setStatus("success"); formRef.current.reset(); } else { setStatus("error"); } }) .catch(() => { setMsg("Error de conexión. Por favor intenta de nuevo."); setStatus("error"); }); } return (
{p.title}

{p.sub}

{msg &&
{msg}
}
{p.fields.map(f => (
))}