37 lines
951 B
Swift
37 lines
951 B
Swift
//
|
||
// WorkoutCardView.swift
|
||
// Workouts
|
||
//
|
||
// Created by rzen on 7/22/25 at 9:54 PM.
|
||
//
|
||
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
|
||
//
|
||
|
||
import SwiftUI
|
||
|
||
struct WorkoutCardView: View {
|
||
let workout: Workout
|
||
|
||
var body: some View {
|
||
VStack(alignment: .leading) {
|
||
if let split = workout.split {
|
||
Image(systemName: split.systemImage)
|
||
.font(.system(size: 48))
|
||
.foregroundStyle(split.getColor())
|
||
} else {
|
||
Image(systemName: "dumbbell.fill")
|
||
.font(.system(size: 24))
|
||
.foregroundStyle(.gray)
|
||
}
|
||
|
||
Text(workout.split?.name ?? "Workout")
|
||
.font(.headline)
|
||
.foregroundStyle(.white)
|
||
|
||
Text(workout.statusName)
|
||
.font(.caption)
|
||
.foregroundStyle(Color.accentColor)
|
||
}
|
||
}
|
||
}
|