//
//  SheetHeaderView.swift
//  lichunWebsocket
//
//  Simplified header for modal sheets showing key resources with cozy styling
//

import SwiftUI

struct SheetHeaderView: View {
    @EnvironmentObject var webSocketService: WebSocketService

    var body: some View {
        BaseCard(
            backgroundColor: .clear,
            borderColor: AppColors.primary.opacity(0.2),
            showShadow: true
        ) {
            HStack(spacing: AppSpacing.md) {
                ResourcePill(
                    icon: "bolt.fill",
                    value: "\(webSocketService.person.calcEnergy)",
                    color: AppColors.energy
                )

                Spacer()

                ResourcePill(
                    icon: "gem.fill",
                    value: "\(webSocketService.person.diamonds)",
                    color: AppColors.diamond
                )

                Spacer()

                ResourcePill(
                    icon: "dollarsign.circle.fill",
                    value: "\(webSocketService.person.money)",
                    color: AppColors.money
                )
            }
        }
        .background(
            LinearGradient(
                colors: [
                    AppColors.surfaceElevated.opacity(0.95),
                    AppColors.surfaceElevated.opacity(0.85)
                ],
                startPoint: .topLeading,
                endPoint: .bottomTrailing
            )
            .cornerRadius(AppSpacing.largeCornerRadius)
        )
        .padding(.horizontal, AppSpacing.md)
        .padding(.vertical, AppSpacing.sm)
    }
}

// MARK: - Supporting Views
// ResourcePill is now in Shared/Components/Stats/ResourcePill.swift

// MARK: - Preview
// Preview removed - requires backend connection
