Files
workouts/Workouts Watch App/Views/Exercises/Cards/ExerciseDoneCard.swift
2025-08-08 21:09:11 -04:00

51 lines
1.3 KiB
Swift
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// ExerciseDoneCard.swift
// Workouts
//
// Created by rzen on 7/23/25 at 4:29PM.
//
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
//
import SwiftUI
struct ExerciseDoneCard: View {
let elapsedSeconds: Int
let onComplete: () -> Void
let onOneMoreSet: () -> Void
var body: some View {
VStack(spacing: 12) {
Text("Exercise Complete!")
.font(.headline)
.foregroundColor(.green)
Button(action: onComplete) {
Text("Done in \(10 - elapsedSeconds)s")
.font(.subheadline)
.frame(maxWidth: .infinity)
}
.buttonStyle(.borderedProminent)
.tint(.green)
.padding(.horizontal)
Button(action: onOneMoreSet) {
Text("One More Set")
.font(.subheadline)
.frame(maxWidth: .infinity)
}
.buttonStyle(.bordered)
.tint(.blue)
.padding(.horizontal)
}
.padding()
}
private var timeFormatted: String {
let minutes = elapsedSeconds / 60
let seconds = elapsedSeconds % 60
return String(format: "%02d:%02d", minutes, seconds)
}
}