import SwiftUI
import HealthDB
import HealthKitExtensions

struct HearingSamplesList: View {

    let database: HealthDatabase

    var body: some View {
        List {
            Text("Audiogram")
                .foregroundStyle(.secondary)
            QuantitySampleRow<EnvironmentalAudioExposure>(database: database)
            CategoryEnumSampleRow<EnvironmentalAudioExposureEvent>(database: database)
            QuantitySampleRow<EnvironmentalSoundReduction>(database: database)
            QuantitySampleRow<HeadphoneAudioExposure>(database: database)
            CategoryEnumSampleRow<HeadphoneAudioExposureEvent>(database: database)
        }
        .navigationTitle("Hearing")
    }
}

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