// Resultado — celebration screen after a game const Resultado = ({ result, profile, onAgain, onHome, onShare, onDiploma }) => { const t = window.MP_I18N.t; const [showConfetti, setShow] = React.useState(true); React.useEffect(() => { window.MP_SOUND.celebrate(); const timer = setTimeout(() => setShow(false), 2400); return () => clearTimeout(timer); }, []); const { score, correct, total, mode, perfect, isBest, newBadges, newMascots } = result; const headline = perfect ? t('perfect') : score > 100 ? t('amazing') : score > 50 ? t('great_job') : t('well_done'); return ( <>
★ MULTIPLIER

{headline}

{score}
{t('total_score')}
{isBest &&
🏆 {t('new_record')}
}
{t('you_got')}
{correct}/{total}
{t('streak')}
🔥 {profile.streak}
{(newBadges?.length || newMascots?.length) ? (
{newBadges?.map(id => { const b = window.MP_DATA.BADGES.find(x => x.id === id); if (!b) return null; return (
{b.icon}
{t('new_badge')}
{b.name[window.MP_I18N.getLang()]}
); })} {newMascots?.map(id => { const m = window.MP_DATA.MASCOTS.find(x => x.id === id); if (!m) return null; return (
{t('new_mascot')}
{m.name}
); })}
) : null}
); }; window.Resultado = Resultado;