import SwiftUI
import HealthDB
import HealthKitExtensions

struct NutritionSamplesList: View {

    let database: HealthDatabase

    var body: some View {
        List {
            QuantitySampleRow<DietaryBiotin>(database: database, title: "Biotin")
            QuantitySampleRow<DietaryCaffeine>(database: database, title: "Caffeine")
            QuantitySampleRow<DietaryCalcium>(database: database, title: "Calcium")
            QuantitySampleRow<DietaryCarbohydrates>(database: database, title: "Carbohydrates")
            QuantitySampleRow<DietaryChloride>(database: database, title: "Chloride")
            QuantitySampleRow<DietaryChromium>(database: database, title: "Chromium")
            QuantitySampleRow<DietaryCopper>(database: database, title: "Copper")
            QuantitySampleRow<DietaryCholesterol>(database: database)
            QuantitySampleRow<DietaryEnergyConsumed>(database: database, title: "Dietary Energy")
            QuantitySampleRow<DietarySugar>(database: database)
            QuantitySampleRow<DietaryFiber>(database: database, title: "Fiber")
            QuantitySampleRow<DietaryFolate>(database: database, title: "Folate")
            QuantitySampleRow<DietaryIodine>(database: database, title: "Iodine")
            QuantitySampleRow<DietaryIron>(database: database, title: "Iron")
            QuantitySampleRow<DietaryMagnesium>(database: database, title: "Magnesium")
            QuantitySampleRow<DietaryManganese>(database: database, title: "Manganese")
            QuantitySampleRow<DietaryMolybdenum>(database: database, title: "Molybdenum")
            QuantitySampleRow<DietaryFatMonounsaturated>(database: database, title: "Monounsaturated Fat")
            QuantitySampleRow<DietaryNiacin>(database: database, title: "Niacin")
            QuantitySampleRow<DietaryPantothenicAcid>(database: database, title: "Pantothenic Acid")
            QuantitySampleRow<DietaryPhosphorus>(database: database, title: "Phosphorus")
            QuantitySampleRow<DietaryFatPolyunsaturated>(database: database, title: "Polyunsaturated Fat")
            QuantitySampleRow<DietaryPotassium>(database: database, title: "Potassium")
            QuantitySampleRow<DietaryProtein>(database: database, title: "Protein")
            QuantitySampleRow<DietaryRiboflavin>(database: database, title: "Riboflavin")
            QuantitySampleRow<DietaryFatSaturated>(database: database, title: "Saturated Fat")
            QuantitySampleRow<DietarySelenium>(database: database, title: "Selenium")
            QuantitySampleRow<DietarySodium>(database: database, title: "Sodium")
            QuantitySampleRow<DietaryThiamin>(database: database, title: "Thiamine")
            QuantitySampleRow<DietaryFatTotal>(database: database, title: "Total Fat")
            QuantitySampleRow<DietaryVitaminA>(database: database, title: "Vitamin A")
            QuantitySampleRow<DietaryVitaminB6>(database: database, title: "Vitamin B6")
            QuantitySampleRow<DietaryVitaminB12>(database: database, title: "Vitamin B12")
            QuantitySampleRow<DietaryVitaminC>(database: database, title: "Vitamin C")
            QuantitySampleRow<DietaryVitaminD>(database: database, title: "Vitamin D")
            QuantitySampleRow<DietaryVitaminE>(database: database, title: "Vitamin E")
            QuantitySampleRow<DietaryVitaminK>(database: database, title: "Vitamin K")
            QuantitySampleRow<DietaryWater>(database: database, title: "Water")
            QuantitySampleRow<DietaryZinc>(database: database, title: "Zinc")
        }
        .navigationTitle("Nutrition")
    }
}

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