Files
2023-04-29 10:41:34 -04:00

34 lines
732 B
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// The MIT License (MIT)
//
// Copyright (c) 2020–2023 Alexander Grebenyuk (github.com/kean).
#if os(iOS) || os(macOS)
import Foundation
import SwiftUI
enum ConsoleSearchToken: Identifiable, Hashable, Codable {
var id: ConsoleSearchToken { self }
case filter(ConsoleSearchFilter)
case term(ConsoleSearchTerm)
var systemImage: String? {
switch self {
case .filter: return "line.3.horizontal.decrease.circle.fill"
case .term: return nil
}
}
var title: String {
switch self {
case .filter(let filter):
return filter.filter.token
case .term(let term):
return term.text // This should never be used
}
}
}
#endif