@props(['status' => '']) @php // Maps every appointment/payment status to a bootstrap-ish pill class. $map = [ 'pending_allocation' => ['label' => 'Pending Allocation', 'class' => 'badge-warning'], 'allocated' => ['label' => 'Allocated', 'class' => 'badge-info'], 'confirmed' => ['label' => 'Confirmed', 'class' => 'badge-info'], 'in_consultation' => ['label' => 'In Consultation', 'class' => 'badge-primary'], 'completed' => ['label' => 'Completed', 'class' => 'badge-success'], 'cancelled' => ['label' => 'Cancelled', 'class' => 'badge-danger'], 'no_show' => ['label' => 'No Show', 'class' => 'badge-muted'], 'paid' => ['label' => 'Paid', 'class' => 'badge-success'], 'pending' => ['label' => 'Pending', 'class' => 'badge-warning'], 'active' => ['label' => 'Active', 'class' => 'badge-success'], 'inactive' => ['label' => 'Inactive', 'class' => 'badge-muted'], ]; $key = strtolower((string) $status); $meta = $map[$key] ?? ['label' => ucwords(str_replace('_', ' ', $key)), 'class' => 'badge-muted']; @endphp merge(['class' => 'status-pill ' . $meta['class']]) }}>{{ $meta['label'] }}