// Perfil β€” stats, badges, mascots, diploma const Perfil = ({ profile, onUpdate, onLogout, onDiploma }) => { const t = window.MP_I18N.t; const lvl = window.MP_DATA.levelFor(profile.points || 0); const lang = window.MP_I18N.getLang(); const equipMascot = (id) => { if (!profile.mascotsUnlocked.includes(id)) return; window.MP_SOUND.tap(); onUpdate({ ...profile, mascot: id }); }; const switchLang = () => { const next = lang === 'es' ? 'en' : 'es'; window.MP_I18N.setLang(next); onUpdate({ ...profile, lang: next }); }; return ( <>
πŸ‘€ {t('profile')}
{profile.firstName} {profile.lastInitial}.
{profile.schoolName || 'β€”'}{profile.grade ? ' Β· ' + profile.grade + 'Β°' : ''}
{lvl.curr.name[lang]} ⭐ {profile.points} πŸ”₯ {profile.streak}

πŸ“Š {t('stats')}

πŸ… {t('badges')} ({(profile.badges||[]).length}/{window.MP_DATA.BADGES.length})

{window.MP_DATA.BADGES.map(b => { const owned = profile.badges?.includes(b.id); return (
{owned ? b.icon : 'πŸ”’'}
{b.name[lang]}
); })}

πŸ›Έ {t('mascots')}

{window.MP_DATA.MASCOTS.map(m => { const unlocked = profile.mascotsUnlocked.includes(m.id); const equipped = profile.mascot === m.id; return (
equipMascot(m.id)} >
{m.name}
{equipped ? 'βœ“ ' + t('equipped') : unlocked ? t('change_mascot') : `πŸ”’ ${m.unlock} ${t('points')}`}
); })}
); }; const Stat = ({ label, value, color }) => (
{value}
{label}
); window.Perfil = Perfil;