import SwiftUI

@main
struct BusinessCardWatchApp: App {
    @State private var cardStore = WatchCardStore()

    init() {
        // Wire up WatchConnectivity to receive cards from iPhone
        let store = cardStore
        WatchConnectivityService.shared.onCardsReceived = { cards in
            Task { @MainActor in
                store.updateCards(cards)
            }
        }
    }

    var body: some Scene {
        WindowGroup {
            WatchContentView()
                .environment(cardStore)
        }
    }
}
