// profile.jsx — Профиль: подписка (подробно — экран «Мой тариф»), ответы анкеты, промокод // на Хакку-коворк, Telegram, выход. function Profile({ nav }) { const { user, member, profile } = ME(); const cfg = CFG(); const active = member.state === 'active'; const [cowork, setCowork] = React.useState(null); React.useEffect(() => { if (!active || !profile) return; fetch('/api/coworking', { credentials:'same-origin' }).then(r => r.json()).then(j => setCowork(j && j.coworking)).catch(() => {}); }, []); const goal = goalTitleOf(profile); const fresh = profile && profile.first_name; // анкета п. 3.2; старые — с уровнем, ролью, «делиться» const sphere = profile && profile.sphere && (profile.sphere === 'other' ? (profile.sphere_custom || 'Другое') : ((cfg.spheres || []).find(s => s.id === profile.sphere) || {}).title); const level = profile && (cfg.levels || []).find(l => l.id === profile.ai_level); const role = profile && profile.role && (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 }) => (
{user.email} · вход через Hakku ID
Анкета обновилась: добавились город, сфера и пара слов о себе. Дополни, чтобы мы знакомили тебя с участниками рядом.
> )} {!profile &&Анкета не заполнена. Заполни, чтобы получить подборку материалов под цель.
}