mirror of
https://github.com/yattee/yattee.git
synced 2024-11-10 00:08:21 +00:00
23 lines
528 B
Swift
23 lines
528 B
Swift
import SwiftUI
|
|
|
|
struct SearchView: View {
|
|
@ObservedObject private var provider = SearchedVideosProvider()
|
|
@EnvironmentObject private var profile: Profile
|
|
@EnvironmentObject private var state: AppState
|
|
|
|
@State private var query = ""
|
|
|
|
var body: some View {
|
|
VideosView(videos: videos)
|
|
.environmentObject(state)
|
|
.environmentObject(profile)
|
|
.searchable(text: $query)
|
|
}
|
|
|
|
var videos: [Video] {
|
|
provider.load(query)
|
|
|
|
return provider.videos
|
|
}
|
|
}
|