@props(['steps' => [], 'current' => 1, 'currentExpression' => null])
@php
$isDynamic = filled($currentExpression);
@endphp
{{-- Desktop / tablet: vertical stepper --}}
@foreach ($steps as $index => $step)
@php
$stepNumber = $index + 1;
$isDone = $stepNumber < $current;
$isActive = $stepNumber === (int) $current;
$isLast = $stepNumber === count($steps);
@endphp
-
@unless ($isLast)
@endunless
@if ($isDynamic)
{{ $stepNumber }}
@elseif ($isDone)
@else
{{ $stepNumber }}
@endif
{{ $step['label'] }}
@if (! empty($step['description']))
{{ $step['description'] }}
@endif
@endforeach
{{-- Mobile: compact horizontal stepper --}}
@if ($isDynamic)
@foreach ($steps as $index => $step)
{{ __('canc.ui.step_of', ['current' => $index + 1, 'total' => count($steps)]) }}
{{ $step['label'] }}
@endforeach
@else
{{ __('canc.ui.step_of', ['current' => $current, 'total' => count($steps)]) }}
{{ $steps[$current - 1]['label'] ?? '' }}
@endif