@php $events = $getState() ?? collect(); $dotColors = [ 'order_placed' => '#16a34a', 'status_change' => '#3b82f6', 'item_edit' => '#f59e0b', 'shipping_change' => '#06b6d4', 'credit_issued' => '#16a34a', 'note_added' => '#9ca3af', ]; $badgeColors = [ 'order_placed' => 'background:#dcfce7;color:#15803d', 'status_change' => 'background:#dbeafe;color:#1d4ed8', 'item_edit' => 'background:#fef3c7;color:#b45309', 'shipping_change' => 'background:#cffafe;color:#0e7490', 'credit_issued' => 'background:#dcfce7;color:#15803d', 'note_added' => 'background:#f3f4f6;color:#6b7280', ]; $labels = [ 'order_placed' => 'Order Placed', 'status_change' => 'Status Update', 'item_edit' => 'Items Modified', 'shipping_change' => 'Shipping Updated', 'credit_issued' => 'Credit Issued', 'note_added' => 'Note Added', ]; @endphp @if($events->isEmpty())
No events recorded yet.
@else
    @foreach($events as $i => $event) @php $isLast = $loop->last; $type = $event->event_type ?? 'note_added'; $dot = $dotColors[$type] ?? '#9ca3af'; $badge = $badgeColors[$type] ?? 'background:#f3f4f6;color:#6b7280'; $label = $labels[$type] ?? ucfirst(str_replace('_',' ',$type)); $who = $event->createdBy?->name ?? null; $when = $event->created_at ? $event->created_at->format('d M Y, H:i') : '—'; @endphp
  1. {{-- Spine --}}
    @if(!$isLast)
    @endif
    {{-- Content --}}
    {{ $label }} {{ $when }}

    {{ $event->description }}

    @if($who)

    by {{ $who }}

    @endif
  2. @endforeach
@endif