import SwiftUI
import Bedrock

struct WidgetPhonePreviewCard: View {
    let card: BusinessCard

    var body: some View {
        WidgetSurfaceCard {
            Label("Phone Widget", systemImage: "iphone")
                .styled(.headingEmphasis)

            HStack(spacing: Design.Spacing.medium) {
                QRCodeView(payload: card.vCardPayload)
                    .frame(width: Design.CardSize.widgetPhoneHeight, height: Design.CardSize.widgetPhoneHeight)
                    .clipShape(.rect(cornerRadius: Design.CornerRadius.medium))

                VStack(alignment: .leading, spacing: Design.Spacing.xSmall) {
                    Text(card.fullName)
                        .styled(.subheadingEmphasis)
                        .lineLimit(2)

                    Text(card.role)
                        .styled(.caption, emphasis: .secondary)
                        .lineLimit(1)

                    Text("Tap to share")
                        .styled(.caption2, emphasis: .tertiary)
                }
                .frame(maxWidth: .infinity, alignment: .leading)
            }
        }
    }
}
