// apps/mobile/app/(tabs)/settings.tsx // 설정 탭 — 계정, 백엔드, 환경설정 // Phase M-2에서 디자인(docs/v3/designs/settings.html) 정밀 적용 import { View, ScrollView, StyleSheet, Alert, Switch } from 'react-native' import { useSafeAreaInsets } from 'react-native-safe-area-context' import { MetalCard, PhosphorText, PhysicalButton, Led, d3roNativePalette } from '@d3ro/ui-native' import { useAuth } from '../../lib/auth-context' import { supabase } from '../../lib/supabase' export default function SettingsScreen(): React.ReactElement { const insets = useSafeAreaInsets() const { user } = useAuth() async function handleLogout(): Promise { Alert.alert('Logout', 'Are you sure you want to log out?', [ { text: 'Cancel', style: 'cancel' }, { text: 'Logout', style: 'destructive', onPress: async () => { await supabase.auth.signOut() } } ]) } const initials = user?.email ? user.email.substring(0, 2).toUpperCase() : 'US' return ( {/* Header */} Settings {/* Account Section */} ACCOUNT & PLAN {initials} {user?.email?.split('@')[0] ?? 'User'} {user?.email ?? '—'} TIER FREE {/* Backend Section */} BACKEND CONFIG LLM Model AI processing backend CLAUDE Cloud STT Google Cloud Speech {/* Preferences Section */} PREFERENCES Language Korean Auto Polish Haptic Feedback {/* Logout */} void handleLogout()} /> {/* Status Footer */} CLOUD CONNECTED ) } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: d3roNativePalette.bg.app }, content: { paddingBottom: 120 }, title: { paddingHorizontal: 20, paddingBottom: 12, borderBottomWidth: 1, borderBottomColor: 'rgba(46, 46, 50, 0.5)', fontFamily: undefined }, sectionLabel: { paddingHorizontal: 24, paddingTop: 20, paddingBottom: 8, letterSpacing: 3 }, section: { marginHorizontal: 20, padding: 0, overflow: 'hidden' }, profileRow: { flexDirection: 'row', alignItems: 'center', padding: 16, gap: 12, borderBottomWidth: 1, borderBottomColor: 'rgba(46, 46, 50, 0.5)' }, avatar: { width: 40, height: 40, borderRadius: 20, backgroundColor: d3roNativePalette.bg.inset, borderWidth: 1, borderColor: d3roNativePalette.border.default, justifyContent: 'center', alignItems: 'center' }, profileInfo: { gap: 2 }, row: { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', padding: 16 }, rowBorder: { borderTopWidth: 1, borderTopColor: 'rgba(46, 46, 50, 0.5)' }, rowRight: { flexDirection: 'row', alignItems: 'center' }, logoutWrap: { margin: 20 }, footer: { flexDirection: 'row', justifyContent: 'center', alignItems: 'center', opacity: 0.5, marginTop: 16 } })