39 lines
1.2 KiB
Swift
39 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct BeaconDashboard: View {
|
|
@EnvironmentObject var appState: AppState
|
|
let business: Employment
|
|
@State private var isReady = false
|
|
|
|
var body: some View {
|
|
Group {
|
|
if isReady {
|
|
TabView {
|
|
BeaconListScreen()
|
|
.tabItem {
|
|
Label("Beacons", systemImage: "sensor.tag.radiowaves.forward.fill")
|
|
}
|
|
|
|
ServicePointListScreen()
|
|
.tabItem {
|
|
Label("Service Points", systemImage: "mappin.and.ellipse")
|
|
}
|
|
|
|
ScannerScreen()
|
|
.tabItem {
|
|
Label("Scanner", systemImage: "antenna.radiowaves.left.and.right")
|
|
}
|
|
}
|
|
.tint(.payfritGreen)
|
|
} else {
|
|
ProgressView("Loading...")
|
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
|
}
|
|
}
|
|
.task {
|
|
await APIService.shared.setBusinessId(business.businessId)
|
|
appState.setBusiness(id: business.businessId, name: business.businessName)
|
|
isReady = true
|
|
}
|
|
}
|
|
}
|