// ═══════════════════════════════════════════════════════════════════════════ // QUIZ 8BAC — capa + 3 perguntas + popup de captura // ═══════════════════════════════════════════════════════════════════════════ const QUIZ_LABELS = { tem_trafego: { sim: 'Sim, já invisto/investi', parei: 'Sim, mas parei', nao: 'Ainda não', }, nicho: { estetica: 'Estética e Beleza', saude: 'Saúde e Bem-estar', alimentacao: 'Alimentação e Delivery', educacao: 'Educação e Cursos', info: 'Infoprodutos e Mentorias', ecommerce: 'E-commerce', servicos: 'Serviços Profissionais', imobiliario: 'Imobiliário', }, faturamento: { 'ate-30k': 'Até R$ 30 mil', '30-60k': 'R$ 30 a 60 mil', '60-150k': 'R$ 60 a 150 mil', '150k+': 'R$ 150 mil ou mais', }, atendimento: { mensagem: 'Mensagem no WhatsApp', video: 'Chamada de vídeo', }, }; function labelForNicho(value) { if (!value) return ''; if (value.startsWith('outros:')) return 'Outros: ' + value.slice(7).trim(); return QUIZ_LABELS.nicho[value] || value; } function Quiz({ onCapture, onClose, originText, mode }) { const isOverlay = mode === 'overlay'; const [step, setStep] = React.useState(0); // 0=capa, 1..4=perguntas const [modalOpen, setModalOpen] = React.useState(false); const [answers, setAnswers] = React.useState({ tem_trafego: '', nicho: '', faturamento: '', atendimento: '' }); React.useEffect(() => { if (isOverlay) { document.body.style.overflow = 'hidden'; return () => { document.body.style.overflow = ''; }; } }, [isOverlay]); function startQuiz() { fireCustom('QuizStart'); setStep(1); } function pickAnswer(key, value, eventName) { setAnswers(a => ({ ...a, [key]: value })); fireCustom(eventName, { [key]: value }); const next = step + 1; setTimeout(() => { if (next <= 4) setStep(next); else setModalOpen(true); }, 380); } return (
8 BAC
{onClose && ( )}
{step === 0 && } {step === 1 && ( pickAnswer('tem_trafego', v, 'QuizStep_TemTrafego')} /> )} {step === 2 && ( pickAnswer('nicho', v, 'QuizStep_Nicho')} /> )} {step === 3 && ( pickAnswer('faturamento', v, 'QuizStep_Faturamento')} /> )} {step === 4 && ( pickAnswer('atendimento', v, 'QuizStep_Atendimento')} /> )}
{modalOpen && ( setModalOpen(false)} onSubmit={onCapture} /> )}
); } // ─── CAPA ──────────────────────────────────────────────────────────────────── function Cover({ onStart }) { return (
DESCOBRIR ONDE TÁ VAZANDO · 1 MINUTO

Sua venda online tá
perdendo dinheiro?

Responde 4 perguntas rápidas que eu te mostro onde tá o vazamento e como organizar tua operação — do site à recuperação de cliente perdido.

Seus dados são protegidos · sem spam
); } // ─── PERGUNTA ──────────────────────────────────────────────────────────────── function Question({ current, total, label, sub, options, selected, onAnswer, customPlaceholder }) { const [picked, setPicked] = React.useState(''); const [customText, setCustomText] = React.useState(''); const [showCustom, setShowCustom] = React.useState(false); const isLocked = picked && !showCustom; // travado depois de escolha não-custom function handlePick(opt) { if (isLocked) return; if (opt.custom) { setPicked(opt.value); setShowCustom(true); } else { setShowCustom(false); setCustomText(''); setPicked(opt.value); onAnswer(opt.value); } } function handleCustomSubmit(e) { if (e) e.preventDefault(); const txt = customText.trim(); if (!txt) return; onAnswer('outros:' + txt); } const pct = (current / total) * 100; return (
PERGUNTA {current} DE {total} {Math.round(pct)}%

{label}

{sub &&

{sub}

}
{options.map(opt => ( ))}
{showCustom && (
setCustomText(e.target.value)} autoFocus maxLength={60} />
)}
); }