"use client"; import { useTranslations } from 'next-intl'; import { useAuthStore } from '@/stores/auth-store'; import { useEmailStore } from '@/stores/email-store'; import { SettingsSection, SettingItem } from './settings-section'; import { formatFileSize } from '@/lib/utils'; export function AccountSettings() { const t = useTranslations('settings.account'); const { username, serverUrl, isDemoMode, primaryIdentity } = useAuthStore(); const { quota } = useEmailStore(); const quotaPercentage = quota ? Math.round((quota.used / quota.total) * 100) : 0; const displayName = primaryIdentity?.name || (isDemoMode ? 'Demo User' : undefined); return ( {/* Display Name (show in demo mode or when identity has a name) */} {displayName && ( {displayName} )} {/* Email Address */} {username || t('../../common.unknown')} {/* Server */} {serverUrl || t('../../common.unknown')} {/* Storage */} {quota && quota.total > 0 && (
{t('storage.percentage', { percent: quotaPercentage })}
)} {/* Demo mode indicator */} {isDemoMode && ( {t('demo_account')} )} ); }