import SwiftUI

struct GeneralSettingsDetailView: View {

    @ObservedObject
    var generalSettings: GeneralSettings

    var body: some View {
        ScrollView {
            VStack(alignment: .leading) {
                DetailTitle(title: "General",
                            text: "General settings for the webpage")
                
                StringPropertyView(
                    title: "Website URL",
                    text: $generalSettings.url,
                    footer: "The base path where the website is deployed, to generate absolute links")
                
                IntegerPropertyView(
                    title: "Link Preview Image Width",
                    value: $generalSettings.linkPreviewImageWidth,
                    footer: "The maximum width of a link preview image")
                
                IntegerPropertyView(
                    title: "Link Preview Image Height",
                    value: $generalSettings.linkPreviewImageHeight,
                    footer: "The maximum height of a link preview image")
            }
            .padding()
        }
    }
}
