import SwiftUI

struct ResultView: View {
    let title: String
    let subtitle: String
    let selectionLabel: String
    let selectionValue: String
    let outcomeLabel: String
    let outcomeValue: String
    let didWin: Bool
    let winLabel: String
    let loseLabel: String
    let nextRoundTitle: String
    let onNextRound: () -> Void

    var body: some View {
        VStack(alignment: .leading, spacing: HermesTheme.sectionSpacing) {
            HermesSectionHeader(title: title, subtitle: subtitle)

            HStack(spacing: 12) {
                HermesMetricPill(label: selectionLabel, value: selectionValue)
                HermesMetricPill(label: outcomeLabel, value: outcomeValue)
            }

            HStack(spacing: 10) {
                Image(systemName: didWin ? "checkmark.seal.fill" : "xmark.seal.fill")
                    .foregroundStyle(didWin ? HermesTheme.positive : HermesTheme.warning)
                Text(didWin ? winLabel : loseLabel)
                    .font(.headline.weight(.semibold))
                    .foregroundStyle(HermesTheme.textPrimary)
            }

            Button {
                onNextRound()
            } label: {
                Text(nextRoundTitle)
            }
            .buttonStyle(HermesPrimaryButtonStyle())
        }
    }
}
