/* global React, Icon, Button, Eyebrow */ /* Shared ContactModal — accessible, stateful, reusable across all pages */ function ContactModal({ onClose }) { const [form, setForm] = React.useState({ name: '', email: '', company: '', interest: '' }); const [sending, setSending] = React.useState(false); const [sent, setSent] = React.useState(false); const firstInputRef = React.useRef(null); const prevFocusRef = React.useRef(null); React.useEffect(() => { prevFocusRef.current = document.activeElement; firstInputRef.current && firstInputRef.current.focus(); const handleKey = (e) => { if (e.key === 'Escape') onClose(); }; document.addEventListener('keydown', handleKey); return () => { document.removeEventListener('keydown', handleKey); prevFocusRef.current && prevFocusRef.current.focus(); }; }, []); const set = (k) => (e) => setForm(f => ({ ...f, [k]: e.target.value })); const handleSubmit = (e) => { e.preventDefault(); if (!form.name || !form.email) return; setSending(true); setTimeout(() => { setSending(false); setSent(true); }, 1200); }; const labelStyle = { display: 'block', fontSize: 12, fontWeight: 600, color: 'var(--fg2)', marginBottom: 5 }; return ( ); } Object.assign(window, { ContactModal });