@forelse($orders as $order) @php $rowClass = 'hover:bg-surface-container transition-colors'; $statusBg = 'bg-surface-container'; $statusText = 'text-on-surface-variant'; $statusLabel = strtoupper($order->status); if ($order->status === 'escalated') { $rowClass = 'bg-error-container/20 hover:bg-error-container/40 transition-colors'; $statusBg = 'bg-error'; $statusText = 'text-white'; $statusLabel = 'ESCALATED'; } elseif ($order->status === 'searching') { $statusBg = 'bg-[#E8A838]/20'; $statusText = 'text-[#E8A838]'; $statusLabel = 'SEARCHING'; } elseif ($order->status === 'otw') { $statusBg = 'bg-primary-container'; $statusText = 'text-primary'; $statusLabel = 'OTW'; } elseif ($order->status === 'in_progress') { $statusBg = 'bg-[#2D8A39]/20'; $statusText = 'text-[#2D8A39]'; $statusLabel = 'PROGRESS'; } elseif ($order->status === 'confirmed') { $statusBg = 'bg-primary-container'; $statusText = 'text-primary'; $statusLabel = 'CONFIRMED'; } elseif ($order->status === 'cancel_requested') { $rowClass = 'bg-rose-50/50 hover:bg-rose-100/50 transition-colors'; $statusBg = 'bg-rose-600'; $statusText = 'text-white'; $statusLabel = 'BATAL DIMINTA'; } elseif ($order->status === 'reschedule_requested') { $rowClass = 'bg-blue-50/50 hover:bg-blue-100/50 transition-colors'; $statusBg = 'bg-blue-600'; $statusText = 'text-white'; $statusLabel = 'RESCHEDULE'; } elseif ($order->status === 'pending') { $statusBg = 'bg-amber-100'; $statusText = 'text-amber-800'; $statusLabel = 'PENDING'; } $diff = $order->created_at ? $order->created_at->diffInMinutes(now()) : 0; $hours = floor($diff / 60); $minutes = $diff % 60; $durationStr = sprintf('%02d:%02d', $hours, $minutes); @endphp @empty @endforelse
Code Status Mitra / User Durasi Aksi
{{ $order->order_number }} {{ $order->created_at ? $order->created_at->format('d M Y, H:i') : '-' }} @if($order->status === 'cancel_requested' && $order->cancel_reason) Alasan: {{ $order->cancel_reason }} @elseif($order->status === 'reschedule_requested' && $order->rescheduled_date) Ke: {{ $order->rescheduled_date ? $order->rescheduled_date->format('d M Y') : '' }} ({{ $order->rescheduled_time }}) @endif
{{ $statusLabel }}
{{ $order->mitra ? $order->mitra->name : 'Mencari Mitra...' }} ke {{ $order->user ? $order->user->name : 'Pelanggan' }}
{{ $durationStr }} @if($order->status === 'cancel_requested')
@csrf
@csrf
@elseif($order->status === 'reschedule_requested')
@csrf
@csrf
@elseif($order->status === 'escalated') @else visibility @endif
Belum ada pesanan aktif saat ini.