41 lines
874 B
Swift
41 lines
874 B
Swift
//
|
|
// ActiveWorkoutSessionListItem.swift
|
|
// WorkoutsPlus
|
|
//
|
|
// Created by Felix Förtsch on 19.09.24.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ActiveWorkoutSessionListItem: View {
|
|
var workoutItem: WorkoutItem
|
|
|
|
var body: some View {
|
|
HStack {
|
|
switch workoutItem.workoutItemType {
|
|
case .set:
|
|
Text(workoutItem.name)
|
|
case .exercise:
|
|
Text(workoutItem.name)
|
|
Spacer()
|
|
Button(action: {
|
|
// TODO: Implement a sheet view; don't use ExerciseDetail since its purpose is editing
|
|
}) {
|
|
Image(systemName: "info.circle")
|
|
.foregroundColor(.blue)
|
|
}
|
|
case .rest:
|
|
Text("Pause")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
List {
|
|
ForEach(WorkoutItem.sampleDataRecommendedRoutine) { item in
|
|
ActiveWorkoutSessionListItem(workoutItem: item)
|
|
}
|
|
}
|
|
}
|