//
//  WiredTransferHeaderView.swift
//  suixinkan
//

import SwiftUI

/// 有线传图页蓝色顶栏，展示相册名与手机号。
struct WiredTransferHeaderView: View {
    let albumTitle: String
    let headerPhone: String
    let onBack: () -> Void

    var body: some View {
        VStack(spacing: 0) {
            HStack(alignment: .center, spacing: 0) {
                Button(action: onBack) {
                    Image(systemName: "chevron.left")
                        .font(.system(size: 18, weight: .semibold))
                        .foregroundStyle(.white)
                        .frame(width: 44, height: 44)
                }
                .buttonStyle(.plain)

                VStack(alignment: .leading, spacing: 2) {
                    Text(albumTitle)
                        .font(.system(size: 20, weight: .bold))
                        .foregroundStyle(.white)
                        .lineLimit(1)
                    if !headerPhone.isEmpty {
                        Text(headerPhone)
                            .font(.system(size: 13))
                            .foregroundStyle(.white.opacity(0.92))
                            .lineLimit(1)
                    }
                }
                .frame(maxWidth: .infinity, alignment: .leading)
                .padding(.trailing, 8)
            }
            .padding(.bottom, 22)
        }
        .frame(maxWidth: .infinity)
        .background(AppDesign.primary)
    }
}
