32 lines
849 B
Swift
32 lines
849 B
Swift
//
|
|
// CountdownView.swift
|
|
// Werkout_ios
|
|
//
|
|
// Created by Trey Tartt on 7/7/23.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct CountdownView: View {
|
|
@StateObject var bridgeModule = BridgeModule.shared
|
|
|
|
var body: some View {
|
|
if let duration = bridgeModule.currentExerciseInfo.currentExercise?.duration,
|
|
duration > 0 {
|
|
HStack {
|
|
if bridgeModule.currentExerciseTimeLeft >= 0 && duration > bridgeModule.currentExerciseTimeLeft {
|
|
ProgressView(value: Float(bridgeModule.currentExerciseTimeLeft), total: Float(duration))
|
|
Text("\(bridgeModule.currentExerciseTimeLeft)")
|
|
.font(.body)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
struct CountdownView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
CountdownView()
|
|
}
|
|
}
|