Files
5GUIs-1/Sources/5GUIs/Views/Windows/MainWindow/DetectionStepsView.swift
Helge Heß caa6434312 5 GUIs - initial drop
Ooh LA LA ...
2020-10-01 16:43:06 +02:00

56 lines
1.0 KiB
Swift

//
// DetectionStepsView.swift
// 5 GUIs
//
// Copyright © 2020 ZeeZide GmbH. All rights reserved.
//
import SwiftUI
/**
* Showing a list of fake detection steps. Driven by the
* `FakeDetectionStepper` (which is just a timed walk
* through the steps).
*/
struct DetectionStepsView: View {
@ObservedObject var stepper : FakeDetectionStepper
var body: some View {
VStack(spacing: 12) {
ForEach(stepper.activeSteps) { step in
StepView(step: step)
}
}
}
/**
* Just a single step "badge".
*/
struct StepView: View {
let step : FakeDetectionStepper.ActiveStep
var body: some View {
HStack {
if step.state != nil {
Text(step.title)
Spacer()
Text(step.checkmark)
}
else {
Spacer()
Text(step.config.runTitle)
Spacer()
}
}
.font(.callout)
.padding(16)
.background(
RoundedRectangle(cornerRadius: 16)
.fill(style.lightShrugsBlue)
)
}
}
}