summaryrefslogtreecommitdiff
path: root/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift
blob: 390fd4cb2f36e1fe4ae44405204eebae683a97f1 (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
import SwiftUI

struct PostGridSearchHistoryView: View {
  @EnvironmentObject var settings: SettingsManager
  @Binding var selectedTab: Int
  @Binding var isPresented: Bool
  @ObservedObject var manager: BooruManager

  var body: some View {
    GenericListView(
      manager: manager,
      selectedTab: $selectedTab,
      isPresented: $isPresented,
      title: "Search History",
      emptyMessage: "No History",
      emptyIcon: "magnifyingglass",
      emptyDescription: "Recent searches will appear here.",
      removeAllMessage:
        "Are you sure you want to remove all searches? This action cannot be undone.",
      removeAllButtonText: "Remove All Searches",
      items: settings.searchHistory,
      removeAction: settings.removeSearchHistoryEntry,
      removeActionUUID: settings.removeSearchHistoryEntry
    ) { settings.searchHistory.removeAll() }
  }
}