import SwiftUI

struct SamplesTab: View {

    @ObservedObject
    var database: Database

    var body: some View {
        NavigationStack {
            List {
                if let db = database.store {
                    NavigationLink {
                        ActivitySamplesList(database: db)
                    } label: {
                        Label("Activity", systemSymbol: .flame)

                    }
                    NavigationLink {
                        BodyMeasurementsList(database: db)
                    } label: {
                        Label("Body Measurements", systemSymbol: .figure)
                    }
                    Label("Clinical documents", systemSymbol: .listClipboard)
                        .foregroundColor(.secondary)
                    NavigationLink {
                        CycleTrackingList(database: db)
                    } label: {
                        Label("Cycle Tracking", systemSymbol: .circleHexagonpath)
                    }
                    NavigationLink {
                        HearingSamplesList(database: db)
                    } label: {
                        Label("Hearing", systemSymbol: .ear)
                    }
                    NavigationLink {
                        HeartSamplesList(database: db)
                    } label: {
                        Label("Heart", systemSymbol: .heart)
                    }
                    Label("Medications", systemSymbol: .pills)
                        .foregroundColor(.secondary)
                    NavigationLink {
                        MentalHealthList(database: db)
                    } label: {
                        Label("Mental Wellbeing", systemSymbol: .brainHeadProfile)
                    }
                    NavigationLink {
                        MobilitySamplesList(database: db)
                    } label: {
                        Label("Mobility", systemSymbol: .arrowLeftAndRight)
                    }
                    NavigationLink {
                        NutritionSamplesList(database: db)
                    } label: {
                        Label("Nutrition", systemSymbol: .carrot)
                    }
                    NavigationLink {
                        RespiratorySamplesList(database: db)
                    } label: {
                        Label("Respiratory", systemSymbol: .lungs)
                    }
                    Label("Sleep", systemSymbol: .bedDouble)
                        .foregroundColor(.secondary)
                    NavigationLink {
                        SymptomsList(database: db)
                    } label: {
                        Label("Symptoms", systemSymbol: .listBulletClipboard)
                    }
                    NavigationLink {
                        VitalsList(database: db)
                    } label: {
                        Label("Vitals", systemSymbol: .waveformPathEcgRectangle)
                    }
                    Label("Other Data", systemSymbol: .cross)
                } else {
                    Text("No database loaded")
                }
            }
            .navigationTitle("Health")
        }
    }
}

#Preview {
    SamplesTab(database: Database.empty)
        .preferredColorScheme(.dark)
}
