@props([
'steps' => [], // array of ['title', 'description', 'timestamp', 'status' => done|current|pending]
])
{{--
Timeline (component.md) — generic vertical timeline.
Each step: title, description?, timestamp?, status (done|current|pending).
Usage:
--}}
@php
$dot = [
'done' => 'border-gov-primary bg-gov-primary text-white',
'current' => 'border-gov-primary bg-gov-primary text-white',
'pending' => 'border-border bg-white text-transparent dark:border-dark-border dark:bg-dark-card',
];
$line = [
'done' => 'bg-gov-primary',
'current' => 'bg-gradient-to-b from-gov-primary to-border dark:to-dark-border',
'pending' => 'bg-border dark:bg-dark-border',
];
@endphp
merge(['class' => 'relative animate-fade-in']) }}>
@foreach ($steps as $i => $step)
@php
$state = $step['status'] ?? 'pending';
$isLast = $loop->last;
$isMuted = $state === 'pending';
@endphp
-
{{-- Connector line (skipped on last item) --}}
@unless ($isLast)
@endunless
{{-- Dot --}}
@if ($state === 'done')
@elseif ($state === 'current')
@else
@endif
{{-- Content --}}
{{ $step['title'] ?? '' }}
@if (! empty($step['description']))
{{ $step['description'] }}
@endif
@if (! empty($step['timestamp']))
{{ $step['timestamp'] }}
@endif
@endforeach