// profile.jsx — Профиль: тариф, «оплачено до», переход в PRO, ответы анкеты, выход. function Profile({ nav }) { const { user, member, profile } = ME(); const cfg = CFG(); const active = member.state === 'active'; const goal = profile && (profile.goal === 'other' ? profile.goal_custom : ((cfg.goals || []).find(g => g.id === profile.goal) || {}).title); const level = profile && (cfg.levels || []).find(l => l.id === profile.ai_level); const role = profile && (profile.role === 'other' ? profile.role_custom || 'Другое' : ((cfg.roles || []).find(r => r.id === profile.role) || {}).title); const share = profile && [...(profile.share || []).map(id => ((cfg.share || []).find(s => s.id === id) || {}).title).filter(Boolean), profile.share_custom].filter(Boolean); const Row = ({ k, v }) => (
{k}{v || '—'}
); return (
Профиль

{user.name || user.email}

{user.email} · вход через Hakku ID

Подписка

{active && {TIER_LABEL[member.tier]}}
{active && member.grace_until && member.grace_until !== member.paid_until && !member.admin && (
После даты оплаты доступ держится ещё 3 дня — до {fmtDate(member.grace_until)}.
)} {!member.admin && (member.tier === 'enthusiast' || member.tier === 'kb_only' || !active) && (
{active ? 'Перейти в PRO ↗' : 'Выбрать тариф ↗'} {member.tier === 'enthusiast' && для участников Enthusiast — 4 500 ₽/мес вместо 4 900 ₽}
)}
{active && (

Анкета

{profile ? ( <> ) : (

Анкета не заполнена — заполните, чтобы получить подборку материалов под цель.

)}
)}
); } window.Profile = Profile;