@php /** @var array $timelineSteps */ $lastDoneIndex = -1; foreach ($timelineSteps as $i => $s) { if ($s['done']) { $lastDoneIndex = $i; } } @endphp
@foreach ($timelineSteps as $i => $step) @php $isDone = $step['done']; $isCurrent = $i === $lastDoneIndex; $isLast = $loop->last; // Connector colored only between done steps (and not after the last done step). $nextDone = ! $isLast && ($timelineSteps[$i + 1]['done'] ?? false); $connectorClass = $nextDone ? 'return-timeline__line return-timeline__line--done' : 'return-timeline__line'; $dotClass = $isDone ? 'return-timeline__dot return-timeline__dot--done' : 'return-timeline__dot'; @endphp
@unless ($isLast) @endunless
{{ $step['label'] }}
@if ($step['at']) {{ $step['at']->diffForHumans() }} ยท {{ $step['at']->format('Y-m-d H:i') }} @elseif ($isDone) {{-- Comment: If step is done without timestamp (e.g., rejected or no refund to customer), show completed action status --}} {{ __('labels.action_taken') ?? 'Completed' }} @else {{ __('labels.pending') }} @endif
@endforeach
@once @push('styles') @endpush @endonce