import SwiftUI

struct StepIndicator: View {
    let current: WizardStep

    var body: some View {
        HStack(spacing: 8) {
            ForEach(WizardStep.allCases) { step in
                if step != .done {
                    Circle()
                        .fill(color(for: step))
                        .frame(width: 12, height: 12)
                    if step.rawValue < WizardStep.total - 1 {
                        Rectangle()
                            .fill(Color.gray.opacity(0.3))
                            .frame(height: 1)
                            .frame(maxWidth: 30)
                    }
                }
            }
        }
        .padding(.vertical, 12)
    }

    private func color(for step: WizardStep) -> Color {
        if step.rawValue < current.rawValue { return .green }
        if step == current { return .accentColor }
        return Color.gray.opacity(0.3)
    }
}
