function CTA() { const [fields, setFields] = React.useState({name:'', email:'', phone:'', msg:''}); const [sent, setSent] = React.useState(false); const [sending, setSending] = React.useState(false); const [error, setError] = React.useState(false); const { isMobile } = useViewport(); const set = (k) => (e) => setFields(f => ({...f, [k]: e.target.value})); const inputStyle = { fontFamily:'Helvetica, Arial, sans-serif', fontWeight:400, fontSize:16, padding:'14px 0', background:'transparent', border:'none', borderBottom:'1px solid #DDD9D4', outline:'none', width:'100%', color:'#1D1D1B', borderRadius:0, transition:'border-color 200ms', }; const handleSubmit = async (e) => { e.preventDefault(); setSending(true); setError(false); try { const res = await fetch('https://formsubmit.co/ajax/lucasqueiroz@gmail.com', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify({ Nome: fields.name, Email: fields.email, Telefone: fields.phone, Mensagem: fields.msg, _subject: 'Novo contato pelo site LSQ', _captcha: 'false', }), }); const data = await res.json(); if (data.success === 'true' || data.success === true) { setSent(true); } else { setError(true); } } catch(_) { setError(true); } finally { setSending(false); } }; return (
Contato Resposta em até 48h
{/* Left — heading */}

VAMOS TRABALHAR JUNTOS?*

{/* Form */} {sent ? (
*

Mensagem enviada.

Retornaremos em até 48 horas.

) : (
e.target.style.borderBottomColor='#1D1D1B'} onBlur={e=>e.target.style.borderBottomColor='#DDD9D4'} /> e.target.style.borderBottomColor='#1D1D1B'} onBlur={e=>e.target.style.borderBottomColor='#DDD9D4'} /> e.target.style.borderBottomColor='#1D1D1B'} onBlur={e=>e.target.style.borderBottomColor='#DDD9D4'} />