import SwiftUI
import HealthKitExtensions
import HealthDB

struct CategoryEnumSampleRow<T>: View where T: HKCategoryEnumSample {

    let database: HealthDatabase

    let title: String?

    init(database: HealthDatabase, title: String? = nil) {
        self.database = database
        self.title = title
    }

    var body: some View {
        NavigationLink {
            CategoryEnumSampleList<T>(database: database)
        } label: {
            Text(title ?? T.categoryTypeIdentifier.description)
        }
    }
}

#Preview {
    CategoryEnumSampleRow<AbdominalCramps>(database: .empty)
}
