summaryrefslogtreecommitdiff
path: root/Sora/Views/Settings/SettingsView.swift
blob: 02f9e34b31a8ca79fa15a1e6ce199c3f68cdedfc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import SwiftUI

struct SettingsView: View {
  @EnvironmentObject var settings: Settings

  var body: some View {
    NavigationStack {
      Form {
        Section(header: Text("Provider")) {
          SettingsProviderView()
        }

        Section(header: Text("Thumbnails")) {
          SettingsThumbnailsView()
        }

        Section(header: Text("Details")) {
          SettingsDetailsView()
        }

        Section(header: Text("Search")) {
          SettingsSearchView()
        }

        Section(header: Text("Settings")) {
          Button("Reset to Defaults") {
            settings.resetToDefaults()
          }
        }

        Section(header: Text("Attributions")) {
          SettingsAttributionsView()
        }
      }
      #if os(macOS)
        .formStyle(.grouped)
      #endif
      .navigationTitle("Settings")
    }
  }
}

#Preview {
  SettingsView()
    .environmentObject(Settings())
}