mirror of
https://github.com/kean/Pulse.git
synced 2026-05-30 21:07:33 +00:00
47 lines
1.2 KiB
Swift
47 lines
1.2 KiB
Swift
// The MIT License (MIT)
|
|
//
|
|
// Copyright (c) 2020-2024 Alexander Grebenyuk (github.com/kean).
|
|
|
|
#if os(iOS) || os(macOS) || os(visionOS)
|
|
|
|
import SwiftUI
|
|
import Pulse
|
|
import CoreData
|
|
import Combine
|
|
|
|
@available(iOS 15, visionOS 1.0, *)
|
|
struct ConsoleSearchSuggestionView: View {
|
|
let suggestion: ConsoleSearchSuggestion
|
|
let action: () -> Void
|
|
|
|
var body: some View {
|
|
Button(action: action) {
|
|
HStack {
|
|
if case .apply = suggestion.action {
|
|
Image(systemName: "magnifyingglass")
|
|
.foregroundColor(.accentColor)
|
|
} else {
|
|
Image(systemName: "line.3.horizontal.decrease.circle")
|
|
.foregroundColor(.secondary)
|
|
}
|
|
Text(suggestion.text)
|
|
.lineLimit(1)
|
|
Spacer()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct ShortcutTooltip: View {
|
|
let title: String
|
|
|
|
var body: some View {
|
|
Text(title)
|
|
.font(.caption)
|
|
.foregroundColor(.separator)
|
|
.background(Rectangle().frame(width: 34, height: 28).foregroundColor(Color.separator.opacity(0.2)).cornerRadius(8))
|
|
}
|
|
}
|
|
|
|
#endif
|