ChWebsiteApp/CHDataManagement/Views/Settings/PathSettingsView.swift
2024-12-17 23:24:07 +01:00

74 lines
2.8 KiB
Swift

import SwiftUI
struct PathSettingsView: View {
@Environment(\.language)
private var language
@EnvironmentObject
private var content: Content
var body: some View {
ScrollView {
VStack(alignment: .leading) {
DetailTitle(
title: "Folder Settings",
text: "Select the folders for the app to work.")
FolderOnDiskPropertyView(
title: "Content Folder",
folder: $content.storage.contentPath,
isStale: $content.storage.contentPathUrlIsStale,
footer: "The folder where the raw content of the website is stored") { url in
content.update(contentPath: url)
}
FolderOnDiskPropertyView(
title: "Output Folder",
folder: $content.storage.outputPath,
isStale: $content.storage.outputPathUrlIsStale,
footer: "The folder where the generated website is stored") { url in
content.storage.save(outputPath: url)
}
StringPropertyView(
title: "Pages output folder",
text: $content.settings.paths.pagesOutputFolderPath,
footer: "The path in the output folder where the generated pages are stored")
StringPropertyView(
title: "Tags output folder",
text: $content.settings.paths.tagsOutputFolderPath,
footer: "The path in the output folder where the generated tag pages are stored")
StringPropertyView(
title: "Files output folder",
text: $content.settings.paths.filesOutputFolderPath,
footer: "The path in the output folder where the copied files are stored")
StringPropertyView(
title: "Images output folder",
text: $content.settings.paths.imagesOutputFolderPath,
footer: "The path in the output folder where the generated images are stored")
StringPropertyView(
title: "Videos output folder",
text: $content.settings.paths.videosOutputFolderPath,
footer: "The path in the output folder where the generated videos are stored")
StringPropertyView(
title: "Assets output folder",
text: $content.settings.paths.assetsOutputFolderPath,
footer: "The path in the output folder where assets are stored")
}
.padding()
}
}
}
#Preview {
PathSettingsView()
.environmentObject(Content.mock)
.padding()
}