summaryrefslogtreecommitdiff
path: root/Sora/Views/Settings/Section/SettingsSectionSearchView.swift
blob: e82f8725fd9c5d8ae804aecc9260ba3a9a884b8e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import SwiftUI

struct SettingsSectionSearchView: View {
  @Environment(SettingsManager.self)
  private var settings

  var body: some View {
    @Bindable var settings = settings

    Picker("Suggestions", selection: $settings.searchSuggestionsMode) {
      ForEach(SettingsSearchSuggestionsMode.allCases, id: \.self) { type in
        Text(type.rawValue.capitalized).tag(type)
      }
    }

    Button("Clear Search History") {
      settings.searchHistory.removeAll()
    }
    .trailingFrame()
  }
}