34 lines
898 B
Swift
34 lines
898 B
Swift
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@Environment(GamesViewModel.self) private var viewModel
|
|
|
|
private var multiViewLabel: String {
|
|
let count = viewModel.activeStreams.count
|
|
if count > 0 {
|
|
return "Multi-View (\(count))"
|
|
}
|
|
return "Multi-View"
|
|
}
|
|
|
|
var body: some View {
|
|
TabView {
|
|
Tab("Games", systemImage: "sportscourt.fill") {
|
|
DashboardView()
|
|
}
|
|
Tab("League", systemImage: "list.bullet.rectangle.portrait.fill") {
|
|
LeagueCenterView()
|
|
}
|
|
Tab(multiViewLabel, systemImage: "rectangle.split.2x2.fill") {
|
|
MultiStreamView()
|
|
}
|
|
Tab("Settings", systemImage: "gearshape.fill") {
|
|
SettingsView()
|
|
}
|
|
}
|
|
.task {
|
|
await viewModel.loadGames()
|
|
}
|
|
}
|
|
}
|