import SwiftUI
import HealthDB
import HealthKitExtensions

struct HeartSamplesList: View {

    let database: HealthDatabase

    var body: some View {
        List {
            QuantitySampleRow<HeartRate>(database: database)
            QuantitySampleRow<HeartRateVariabilitySDNN>(database: database, title: "Heart Rate Variability")
            QuantitySampleRow<RestingHeartRate>(database: database)
            QuantitySampleRow<WalkingHeartRateAverage>(database: database)
            QuantitySampleRow<Vo2Max>(database: database, title: "Cardio Fitness")
            CategoryEmptySampleRow<LowHeartRateEvent>(database: database)
            Text("Electrocardiograms (ECG)")
                .foregroundStyle(.secondary)
            #warning("Create view for Electrocardiograms")
            QuantitySampleRow<AtrialFibrillationBurden>(database: database)
            Text("Blood Pressure")
                .foregroundStyle(.secondary)
            #warning("Create view for blood pressure")
            QuantitySampleRow<BloodPressureDiastolic>(database: database)
            QuantitySampleRow<BloodPressureSystolic>(database: database)
            CategoryEnumSampleRow<LowCardioFitnessEvent>(database: database)
            CategoryEmptySampleRow<HighHeartRateEvent>(database: database)
            CategoryEmptySampleRow<IrregularHeartRhythmEvent>(database: database)
            QuantitySampleRow<PeripheralPerfusionIndex>(database: database)
        }
        .navigationTitle("Heart")
    }
}

#Preview {
    NavigationStack {
        HeartSamplesList(database: .empty)
    }
}
