/* 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 (
Novedades en ciberseguridad y ethical hacking — una vez al mes, sin spam.
{status === 'ok' ?{errMsg}
}