diff options
| author | Fuwn <[email protected]> | 2025-02-22 00:07:44 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-02-22 00:07:44 -0800 |
| commit | e42fa12dafe264c665d2574c93b54ddafe7f2e1f (patch) | |
| tree | a362b3b78ea97dc28ce5cc3682801bf89688f546 /Sora/Views/SearchSuggestionsView.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-e42fa12dafe264c665d2574c93b54ddafe7f2e1f.tar.xz sora-testing-e42fa12dafe264c665d2574c93b54ddafe7f2e1f.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/SearchSuggestionsView.swift')
| -rw-r--r-- | Sora/Views/SearchSuggestionsView.swift | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/Sora/Views/SearchSuggestionsView.swift b/Sora/Views/SearchSuggestionsView.swift index b9c3133..91f1f77 100644 --- a/Sora/Views/SearchSuggestionsView.swift +++ b/Sora/Views/SearchSuggestionsView.swift @@ -1,21 +1,23 @@ import SwiftUI struct SearchSuggestionsView: View { - var tags: [BooruTag] - @Binding var searchText: String - var lastSearchTag: String { - String(searchText.split(separator: " ").last ?? "") - } + var tags: [BooruTag] + @Binding var searchText: String + var lastSearchTag: String { + String(searchText.split(separator: " ").last ?? "") + } - var body: some View { - ForEach( - tags.filter { $0.name.lowercased().contains(lastSearchTag) - }) { suggestion in - Button { - searchText.replaceSubrange(searchText.range(of: lastSearchTag)!, with: suggestion.name) - } label: { - Text(suggestion.name) - } - } + var body: some View { + ForEach( + tags.filter { + $0.name.lowercased().contains(lastSearchTag) + } + ) { suggestion in + Button { + searchText.replaceSubrange(searchText.range(of: lastSearchTag)!, with: suggestion.name) + } label: { + Text(suggestion.name) + } } + } } |