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

struct SettingsSearchView: View {
  @EnvironmentObject var settings: SettingsManager

  var body: some View {
    Picker("Suggestion Mode", selection: $settings.searchSuggestionsMode) {
      ForEach(SettingsSearchSuggestionsMode.allCases, id: \.self) { type in
        Text(type.rawValue.capitalized).tag(type)
      }
    }

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