import SwiftUI

struct LocalizedPostFeedSettingsView: View {

    @ObservedObject
    var settings: LocalizedPostSettings

    let transferImage: (language: ContentLanguage, image: FileResource)?

    var body: some View {
        VStack(alignment: .leading) {
            StringPropertyView(
                title: "Default Page Link Text",
                text: $settings.defaultPageLinkText,
                footer: "The text to display when linking from a post to a page. Each post can provide a custom text.")

            StringPropertyView(
                title: "URL prefix",
                text: $settings.feedUrlPrefix,
                footer: "The prefix to generate the urls for all post feed pages.")

            LinkPreviewDetailView(linkPreview: settings.linkPreview, fallbackTitle: nil, transferImage: transferImage)
        }
    }
}

#Preview {
    LocalizedPostFeedSettingsView(
        settings: PostSettings.default.english,
        transferImage: nil)
    .padding()
}
