import React from 'react'; import { useUIStore } from '../../stores/uiStore'; import { useAuthStore } from '../../stores/authStore'; import { AccountPanel } from '../modals/settingsPanels/AccountPanel'; import { VoicePanel } from '../modals/settingsPanels/VoicePanel'; import { ConnectionsPanel } from '../modals/settingsPanels/ConnectionsPanel'; import { PrivacyPanel } from '../modals/settingsPanels/PrivacyPanel'; interface MobileSettingsScreenProps { initialPanel?: string; } const panelConfig: Record = { account: { title: 'Account', component: }, voice: { title: 'Voice & Audio', component: }, privacy: { title: 'Privacy', component: }, connections: { title: 'Connections', component: }, }; const sectionIcons: Record = { account: ( ), voice: ( ), privacy: ( ), connections: ( ), instance: ( ), }; export function MobileSettingsScreen({ initialPanel }: MobileSettingsScreenProps) { const popMobileScreen = useUIStore((s) => s.popMobileScreen); const pushMobileScreen = useUIStore((s) => s.pushMobileScreen); const isAdmin = useAuthStore((s) => s.user?.isAdmin); // If initialPanel is set, render that panel directly if (initialPanel) { const panel = panelConfig[initialPanel]; if (!panel) return null; if (initialPanel === 'instance' && !isAdmin) return null; return (

{panel.title}

{panel.component}
); } // Settings section list const sections = [ { id: 'account', label: 'Account' }, { id: 'voice', label: 'Voice & Audio' }, { id: 'privacy', label: 'Privacy' }, { id: 'connections', label: 'Connections' }, ...(isAdmin ? [{ id: 'instance', label: 'Instance' }] : []), ]; return (

Settings

{sections.map((section) => ( ))}
); }