import SwiftUI struct SettingsView: View { @EnvironmentObject private var settings: AppSettings @Environment(\.dismiss) private var dismiss var body: some View { VStack(alignment: .leading, spacing: 16) { Form { folderRow( title: "Zielordner", caption: "Hier entsteht pro Projekt ein Unterordner mit Original und 4:5-Fassung.", current: settings.targetFolder ) { settings.setTargetFolder($0) } folderRow( title: "Quellordner", caption: "„Dateien wählen …“ öffnet sich hier. Optional.", current: settings.sourceFolder ) { settings.setSourceFolder($0) } } .formStyle(.grouped) HStack { Spacer() Button("Fertig") { dismiss() } .buttonStyle(ProminentButtonStyle()) .keyboardShortcut(.defaultAction) } .padding([.horizontal, .bottom], 20) } .frame(width: 520, height: 300) } private func folderRow(title: LocalizedStringKey, caption: LocalizedStringKey, current: URL?, onChoose: @escaping (URL) -> Void) -> some View { LabeledContent { Button("Wählen …") { if let url = FolderPicker.choose(startingAt: current) { onChoose(url) } } } label: { Text(title) Text(current?.path ?? String(localized: "Nicht gesetzt")) .lineLimit(1) .truncationMode(.middle) Text(caption) } } }