/* Contact.jsx — formulario de presupuesto */ const OBRA_TIPOS = ["Movimiento de suelos", "Pavimento de hormigón", "Pavimento asfáltico", "Adoquinado", "Mantenimiento vial", "Otro / no estoy seguro"]; const PHONES = [ { label: "351 675-3199", tel: "+5493516753199", wa: "5493516753199" }, { label: "351 563-7672", tel: "+5493515637672", wa: "5493515637672" }, ]; const WA_MSG = encodeURIComponent("Hola RS Vial Constructora, quiero pedir un presupuesto."); function WaIcon({ size = 17 }) { return ( ); } function Field({ label, children, error, span }) { return ( {label}{error ? " · " + error : ""} {children} ); } function Contact({ name }) { const [f, setF] = useState({ nombre: "", empresa: "", email: "", tel: "", tipo: "", msg: "" }); const [err, setErr] = useState({}); const [sent, setSent] = useState(false); const set = (k) => (e) => setF((s) => ({ ...s, [k]: e.target.value })); const inputStyle = { fontFamily: "var(--font-body)", fontSize: "1rem", padding: "13px 14px", border: "1.5px solid var(--line)", borderRadius: 4, background: "var(--paper)", color: "var(--ink)", width: "100%", outline: "none", }; const submit = (e) => { e.preventDefault(); const next = {}; if (!f.nombre.trim()) next.nombre = "requerido"; if (!/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(f.email)) next.email = "email inválido"; if (!f.tipo) next.tipo = "elegí una opción"; setErr(next); if (Object.keys(next).length === 0) setSent(true); }; return ( {PHONES.map((ph, i) => ( Teléfono{PHONES.length > 1 ? " " + (i + 1) : ""} {ph.label} ))} {[ { k: "Email", v: "rsvialcor@gmail.com", href: "mailto:rsvialcor@gmail.com" }, { k: "Obrador", v: "Marino Gabbarini 750, Córdoba", href: "https://maps.google.com/?q=Marino+Gabbarini+750+Cordoba" }, { k: "Oficinas", v: "Leopoldo Lugones 44, 9º B, Córdoba", href: "https://maps.google.com/?q=Leopoldo+Lugones+44+Cordoba" }, { k: "Horarios", v: "Lun a Vie · 8:30 a 18 hs" }, ].map((c) => ( {c.k} {c.href ? {c.v} : {c.v}} ))} Escribinos por WhatsApp {/* form card */} {sent ? ( ¡Recibido! Gracias{f.nombre ? `, ${f.nombre.split(" ")[0]}` : ""}. Te vamos a contactar a la brevedad con tu presupuesto. { setSent(false); setF({ nombre: "", empresa: "", email: "", tel: "", tipo: "", msg: "" }); }} className="btn btn-ghost" style={{ marginTop: 8 }}>Enviar otra consulta ) : ( Elegí una opción… {OBRA_TIPOS.map((o) => {o})} Solicitar presupuesto )} ); } Object.assign(window, { Contact });
Gracias{f.nombre ? `, ${f.nombre.split(" ")[0]}` : ""}. Te vamos a contactar a la brevedad con tu presupuesto.