const { Dialog, Button, Input } = window.JabberwockeeDesignSystem_646027; function ContactDialog({ open, onClose }) { const [email, setEmail] = React.useState(""); const [err, setErr] = React.useState(""); const [sent, setSent] = React.useState(false); const close = () => { onClose(); setTimeout(() => { setSent(false); setErr(""); setEmail(""); }, 300); }; const submit = () => { if (!/.+@.+\..+/.test(email)) { setErr("Enter a valid email"); return; } setErr(""); setSent(true); }; if (sent) return ( Thanks. We'll be in touch.>} footer={Close}> Your message has been received. We reply within two days. ); return ( Get in touch.>} footer={<>CancelSend>}> setEmail(e.target.value)} error={err} /> Message ); } window.ContactDialog = ContactDialog;
Your message has been received. We reply within two days.