import SwiftUI
import HealthDB
import HealthKitExtensions

struct BodyMeasurementsList: View {

    let database: HealthDatabase

    var body: some View {
        List {
            QuantitySampleRow<BasalBodyTemperature>(database: database)
            QuantitySampleRow<BodyFatPercentage>(database: database)
            QuantitySampleRow<BodyMass>(database: database)
            QuantitySampleRow<BodyMassIndex>(database: database)
            QuantitySampleRow<BodyTemperature>(database: database)
            QuantitySampleRow<ElectrodermalActivity>(database: database)
            QuantitySampleRow<Height>(database: database)
            QuantitySampleRow<LeanBodyMass>(database: database)
            Text("Vision prescription")
                .foregroundStyle(.secondary)
            QuantitySampleRow<WaistCircumference>(database: database)
            QuantitySampleRow<AppleSleepingWristTemperature>(database: database, title: "Wrist temperature")
        }
        .navigationTitle("Body Measurements")
    }
}

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