@props([
'steps' => [],
'current' => 1,
])
@php
$totalSteps = count($steps);
$currentIndex = max(0, min((int) $current - 1, $totalSteps - 1));
$currentLabel = is_array($steps[$currentIndex] ?? null)
? ($steps[$currentIndex]['label'] ?? $steps[$currentIndex]['name'] ?? '')
: ($steps[$currentIndex] ?? '');
@endphp
Step {{ $current }} of {{ $totalSteps }}
@if ($currentLabel !== '')
— {{ $currentLabel }}
@endif
{{ $currentLabel ?: 'In progress' }}
merge(['class' => 'wizard-steps installer-wizard-steps mb-4']) }}>
@foreach ($steps as $index => $step)
@php
$stepNumber = $index + 1;
$isActive = $stepNumber === (int) $current;
$isCompleted = $stepNumber < (int) $current;
$label = is_array($step) ? ($step['label'] ?? $step['name'] ?? '') : $step;
$classes = 'wizard-step';
if ($isActive) {
$classes .= ' active';
}
if ($isCompleted) {
$classes .= ' completed';
}
@endphp
{{ $stepNumber }}
{{ $label }}
@endforeach