import SwiftUI struct SettingsView: View { @StateObject private var authViewModel = AuthViewModel() var body: some View { List { Section { HStack { Image(systemName: "person.circle") .font(.system(size: 40)) .foregroundColor(.primary) VStack(alignment: .leading) { Text(authViewModel.userName ?? "User") .font(.headline) Text(authViewModel.userEmail ?? "email@example.com") .font(.subheadline) .foregroundColor(.secondary) } Spacer() } } Section("About") { HStack { Text("Version") Spacer() Text(AppSettings.appVersion) .foregroundColor(.secondary) } HStack { Text("Build") Spacer() Text(AppSettings.buildNumber) .foregroundColor(.secondary) } } Section("Legal") { Link(destination: AppSettings.termsOfServiceURL ?? URL(string: "about:blank")!) { HStack { Text("Terms of Service") Spacer() Image(systemName: "chevron.right") .font(.caption) .foregroundColor(.secondary) } } Link(destination: AppSettings.privacyPolicyURL ?? URL(string: "about:blank")!) { HStack { Text("Privacy Policy") Spacer() Image(systemName: "chevron.right") .font(.caption) .foregroundColor(.secondary) } } } Section("Account") { Button(action: { authViewModel.logout() }) { HStack { Image(systemName: "arrow.right.to.line") Text("Log Out") Spacer() } } Button(role: .destructive, action: { authViewModel.deleteAccount() }) { HStack { Image(systemName: "trash") Text("Delete Account") Spacer() } } } } .navigationTitle("Settings") } } class AuthViewModel: ObservableObject { @Published var userName: String? @Published var userEmail: String? func logout() { // Implement logout logic userName = nil userEmail = nil } func deleteAccount() { // Implement account deletion logic userName = nil userEmail = nil } } #Preview { NavigationView { SettingsView() } }