import SwiftUI struct SettingsView: View { @Bindable var viewModel: BookmarksViewModel let onDisconnect: () -> Void @Environment(\.dismiss) private var dismiss @State private var autoTagText = PodcastRequests.autoTags.joined(separator: " ") var body: some View { NavigationStack { List { Section { Label("Semantic search, auto-tagging, smart collections, and podcast generation are active.", systemImage: "sparkles") .font(PaperType.meta) .foregroundStyle(Paper.secondary) } header: { Text("AI Features").font(PaperType.stamp).foregroundStyle(Paper.tertiary) } Section { TextField("e.g. listen podcast", text: $autoTagText) .font(PaperType.label) .foregroundStyle(Paper.ink) .textInputAutocapitalization(.never) .autocorrectionDisabled() .onChange(of: autoTagText) { _, new in PodcastRequests.autoTags = new .split(whereSeparator: { $0 == " " || $0 == "," }) .map(String.init) } } header: { Text("Auto-Podcast Tags").font(PaperType.stamp).foregroundStyle(Paper.tertiary) } footer: { Text("Saving a bookmark with any of these tags automatically generates a podcast for it.") .font(PaperType.meta) .foregroundStyle(Paper.tertiary) } Section { Button { dismiss() onDisconnect() } label: { Label("Disconnect", systemImage: "person.crop.circle.badge.minus") .font(PaperType.label) .foregroundStyle(Paper.alarm) } } header: { Text("Server").font(PaperType.stamp).foregroundStyle(Paper.tertiary) } } .listRowBackground(Paper.raised) .paperSurface() .navigationTitle("Settings") .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .topBarTrailing) { Button("Done") { dismiss() } .font(PaperType.label) .tint(Paper.accent) } } } } }