import SwiftUI
import HealthKitExtensions
import HealthDB

struct CategoryEmptySampleRow<T>: View where T: HKCategoryEmptySample {

    let database: HealthDatabase

    let title: String?

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

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

#Preview {
    CategoryEmptySampleRow<MindfulSession>(database: .empty)
}
