//
//  ProBadge.swift
//  SportsTime
//
//  Small "PRO" badge indicator for locked features.
//

import SwiftUI

struct ProBadge: View {
    var body: some View {
        Text("PRO")
            .font(.caption2.bold())
            .foregroundStyle(.white)
            .padding(.horizontal, 6)
            .padding(.vertical, 2)
            .background(Theme.warmOrange, in: Capsule())
    }
}

// MARK: - View Modifier

extension View {
    /// Adds a small PRO badge overlay to indicate locked feature
    func proBadge(alignment: Alignment = .topTrailing) -> some View {
        overlay(alignment: alignment) {
            if !StoreManager.shared.isPro {
                ProBadge()
                    .padding(4)
            }
        }
    }
}

#Preview {
    VStack(spacing: 20) {
        ProBadge()

        // Example usage
        RoundedRectangle(cornerRadius: 12)
            .fill(.blue.opacity(0.2))
            .frame(width: 100, height: 60)
            .proBadge()
    }
    .padding()
}
