//
//  TravelAlbumDetailInfoCard.swift
//  suixinkan
//
//  旅拍相册详情信息卡片，对齐 Android AlbumInfoCard。
//

import SwiftUI

/// 旅拍相册详情顶部信息卡片。
struct TravelAlbumDetailInfoCard: View {
    let album: TravelAlbumItem
    let onCallClick: (String) -> Void

    var body: some View {
        HStack(spacing: 12) {
            RoundedRectangle(cornerRadius: TravelAlbumDetailDesign.infoIconCornerRadius)
                .fill(AppDesign.primary)
                .frame(width: TravelAlbumDetailDesign.infoIconSize, height: TravelAlbumDetailDesign.infoIconSize)
                .overlay {
                    Image(systemName: "list.clipboard.fill")
                        .font(.system(size: 28))
                        .foregroundStyle(.white)
                }

            VStack(alignment: .leading, spacing: 6) {
                Text("手机号 \(OrderListUI.maskPhone(album.displayPhone))")
                    .font(.system(size: 14, weight: .medium))
                    .foregroundStyle(TravelAlbumDetailDesign.text333)
                Text("创建时间 \(album.createdAt)")
                    .font(.system(size: 12))
                    .foregroundStyle(TravelAlbumDetailDesign.text999)
            }
            .frame(maxWidth: .infinity, alignment: .leading)

            Button {
                onCallClick(album.displayPhone)
            } label: {
                Circle()
                    .fill(TravelAlbumDetailDesign.lightBlue)
                    .frame(width: TravelAlbumDetailDesign.callButtonSize, height: TravelAlbumDetailDesign.callButtonSize)
                    .overlay {
                        Image(systemName: "phone.fill")
                            .font(.system(size: 20))
                            .foregroundStyle(AppDesign.primary)
                    }
            }
            .buttonStyle(.plain)
            .accessibilityLabel("拨打电话")
        }
        .padding(.horizontal, 14)
        .padding(.vertical, 14)
        .background(Color.white)
        .clipShape(RoundedRectangle(cornerRadius: TravelAlbumDetailDesign.cardCornerRadius))
        .shadow(color: TravelAlbumDetailDesign.cardShadow, radius: TravelAlbumDetailDesign.cardShadowRadius, x: 0, y: 1)
    }
}
