@props([ 'status' => null, 'active' => null, ]) @php $raw = $status; if ($active !== null && $raw === null) { $raw = $active ? 'active' : 'inactive'; } if (is_bool($raw)) { $raw = $raw ? 'active' : 'inactive'; } $key = is_numeric($raw) ? match ((int) $raw) { 2 => 'active', 1 => 'pending', default => 'inactive', } : strtolower((string) $raw); $label = match ($key) { 'active' => __('admin.status_active'), 'inactive' => __('admin.status_inactive'), 'pending' => __('admin.pending'), 'draft' => __('admin.draft'), 'approved' => __('admin.approved'), default => $key !== '' ? $key : '—', }; $class = match ($key) { 'active', 'approved' => 'bg-emerald-100 text-emerald-800', 'pending' => 'bg-amber-100 text-amber-800', 'draft' => 'bg-slate-100 text-slate-600', 'inactive' => 'bg-slate-100 text-slate-600', default => 'bg-slate-100 text-slate-700', }; @endphp merge(['class' => "inline-flex rounded-full px-2.5 py-0.5 text-[11px] font-bold {$class}"]) }}> {{ $label }}