import SwiftUI

struct SettingsContentView: View {

    @Binding
    var language: ContentLanguage

    @Binding
    var section: SettingsSection

    @EnvironmentObject
    private var content: Content

    var body: some View {
        switch section {
        case .general:
            GeneralSettingsDetailView(generalSettings: content.settings.general)
        case .paths:
            PathSettingsView()
        case .navigationBar:
            NavigationBarSettingsView(language: $language)
        case .postFeed:
            PostFeedSettingsView(language: $language, postSettings: content.settings.posts)
        case .pages:
            PageSettingsDetailView(language: $language, pageSettings: content.settings.pages)
        case .tagOverview:
            TagOverviewDetailView(language: $language)
        case .audioPlayer:
            AudioSettingsDetailView(language: $language, audioPlayer: content.settings.audioPlayer)
        }
    }
}

#Preview {
    SettingsContentView(
        language: .constant(.english),
        section: .constant(.paths))
}
