import Foundation
import SwiftUI

/// A simplified card structure synced from the iOS app via WatchConnectivity
struct WatchCard: Codable, Identifiable, Hashable {
    let id: UUID
    var fullName: String
    var role: String
    var company: String
    var email: String
    var phone: String
    var website: String
    var location: String
    var isDefault: Bool
    /// Pre-generated QR code PNG data from iOS (CoreImage not available on watchOS)
    var qrCodeImageData: Data?
    
    /// Returns a SwiftUI Image from the synced QR code data
    var qrCodeImage: Image? {
        guard let data = qrCodeImageData,
              let uiImage = UIImage(data: data) else { return nil }
        return Image(uiImage: uiImage)
    }
}
