@props(['status'])
@php
$flow = [
\App\Enums\OrderStatus::New,
\App\Enums\OrderStatus::Confirmed,
\App\Enums\OrderStatus::Processing,
\App\Enums\OrderStatus::Ready,
\App\Enums\OrderStatus::Shipped,
\App\Enums\OrderStatus::Completed,
];
$currentIndex = array_search($status, $flow, true);
$cancelled = $currentIndex === false; // any cancelled_* status
@endphp
@if ($cancelled)
{{ $status->label() }}
@else
@foreach ($flow as $i => $step)
@php($done = $i < $currentIndex)
@php($active = $i === $currentIndex)
{{-- Макет: активный — синий круг с белой цифрой, будущие — белые с
рамкой и серой цифрой; пройденные — синие с галочкой. --}}
@if ($done)@else {{ $i + 1 }} @endif
{{ $step->label() }}
@endforeach
{{-- На телефоне шесть подписей под кружками налезают друг на друга: «Подтверждён»
вдвое шире своей колонки. Показываем там только текущий шаг — строкой во всю ширину. --}}
Шаг {{ $currentIndex + 1 }} из {{ count($flow) }} — {{ $status->label() }}
@endif