// Settings view — единый стиль BuhApp const SettingsView = { async render(root) { const u = API.Store.user; root.innerHTML = `

⚙️ Настройки

${escapeHtml(((u?.name || u?.email || '?')[0] || '?').toUpperCase())}
${escapeHtml(u?.name || 'Без имени')}
${u?.email ? `
${escapeHtml(u.email)}
` : ''}
v 0.7.0 · BuhApp
`; document.getElementById('logout').onclick = async () => { const ok = await TG_APP.showConfirm('Выйти из BuhApp?'); if (!ok) return; const btn = document.getElementById('logout'); const orig = btn.textContent; btn.className = 'btn-b danger load'; btn.textContent = '⏳ Выходим…'; try { await fetch('https://buhapp.mygoodservice.ru/api/v1/auth/logout', { method: 'POST', credentials: 'include' }); } catch {} btn.className = 'btn-b ok'; btn.textContent = '✓ Готово!'; App.onLogout(); setTimeout(() => location.reload(), 500); }; }, };