// // CaloriesBurnedView.swift // Werkout_ios // // Created by Trey Tartt on 6/18/24. // import SwiftUI struct CaloriesBurnedView: View { @Binding var healthKitWorkoutData: HealthKitWorkoutData? let calsBurned: Double var body: some View { VStack(spacing: WerkoutTheme.sm) { HStack { HStack(spacing: WerkoutTheme.sm) { Image(systemName: "flame.fill") .foregroundStyle(.orange) .font(.title) Text("\(calsBurned, specifier: "%.0f")") .font(.system(size: 28, weight: .black, design: .monospaced)) .foregroundStyle(WerkoutTheme.textPrimary) } .frame(maxWidth: .infinity) } if let minHeart = healthKitWorkoutData?.minHeartRate, let maxHeart = healthKitWorkoutData?.maxHeartRate, let avgHeart = healthKitWorkoutData?.avgHeartRate { VStack(spacing: WerkoutTheme.xs) { HStack(spacing: WerkoutTheme.sm) { Image(systemName: "heart.fill") .foregroundStyle(WerkoutTheme.danger) .font(.title) VStack { HStack { Text("\(minHeart, specifier: "%.0f")") Text("-") .foregroundStyle(WerkoutTheme.textMuted) Text("\(maxHeart, specifier: "%.0f")") } .font(.system(size: 20, weight: .bold, design: .monospaced)) .foregroundStyle(WerkoutTheme.textPrimary) Text("avg \(avgHeart, specifier: "%.0f")") .font(WerkoutTheme.caption) .foregroundStyle(WerkoutTheme.textSecondary) } } } .frame(maxWidth: .infinity) } } .werkoutCard() } }