/* global React, Logo, Icon, Btn */ // Resolve URL prefix so footer links work from /servicios/* and /blog/* subpages too. const FROOT = typeof window !== 'undefined' && (window.location.pathname.includes('/servicios/') || window.location.pathname.includes('/blog/')) ? '../' : ''; const NewsletterFooter = () => { const { Btn } = window; const [email, setEmail] = React.useState(''); const [status, setStatus] = React.useState('idle'); // idle | sending | ok | error const [errMsg, setErrMsg] = React.useState(''); const submit = async (e) => { e.preventDefault(); if (!email.includes('@')) return; setStatus('sending');setErrMsg(''); try { const { ok, data } = await window.brotekFetch('/api/newsletter.php', { body: { email, source: 'footer', website: '' } }); if (!ok) { setErrMsg(data && data.message || 'No pudimos suscribirte. Probá de nuevo.'); setStatus('error');return; } setStatus('ok');setEmail(''); } catch (_) { setErrMsg('Error de red. Intentá de nuevo en unos minutos.'); setStatus('error'); } }; return (

Newsletter

Novedades en ciberseguridad y ethical hacking — una vez al mes, sin spam.

{status === 'ok' ?
¡Gracias por suscribirte!
:
setEmail(e.target.value)} placeholder="tu@empresa.com" style={{ flex: 1, minWidth: 0, background: 'rgba(255,255,255,.04)', border: '1px solid rgba(255,255,255,.10)', borderRadius: 999, padding: '10px 16px', color: 'var(--fg)', fontFamily: 'var(--font-body)', fontSize: 13, outline: 'none' }} /> {status === 'sending' ? 'Enviando…' : 'Suscribirme'}
} {status === 'error' &&

{errMsg}

}
); }; const Footer = () => ; window.Footer = Footer;