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

struct SettingsSectionSearchView: View {
  @EnvironmentObject var settings: SettingsManager

  var body: some View {
    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()
  }
}