import SwiftUI
import HealthDB
import HealthKitExtensions

struct MobilitySamplesList: View {

    let database: HealthDatabase

    var body: some View {
        List {
            QuantitySampleRow<Vo2Max>(database: database, title: "Cardio Fitness")
            QuantitySampleRow<WalkingDoubleSupportPercentage>(database: database, title: "Double Support Time")
            QuantitySampleRow<RunningGroundContactTime>(database: database, title: "Ground Contact Time")
            QuantitySampleRow<RunningStrideLength>(database: database)
            QuantitySampleRow<SixMinuteWalkTestDistance>(database: database, title: "Six-Minute Walk")
            QuantitySampleRow<StairDescentSpeed>(database: database, title: "Stair Speed: Down")
            QuantitySampleRow<StairAscentSpeed>(database: database, title: "Stair Speed: Up")
            QuantitySampleRow<RunningVerticalOscillation>(database: database, title: "Vertical Oscillation")
            QuantitySampleRow<WalkingAsymmetryPercentage>(database: database, title: "Walking Asymmetry")
            QuantitySampleRow<WalkingSpeed>(database: database)
            QuantitySampleRow<AppleWalkingSteadiness>(database: database, title: "Walking Steadiness")
            QuantitySampleRow<WalkingStepLength>(database: database)
            CategoryEnumSampleRow<AppleWalkingSteadinessEvent>(database: database, title: "Walking Steadiness Notifications")
        }
        .navigationTitle("Mobility")
    }
}

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