Moved service.widget.status to a component

This commit is contained in:
Deon George 2024-07-24 17:45:32 +10:00
parent 14609fb377
commit 79237868cb
2 changed files with 6 additions and 12 deletions

View File

@ -0,0 +1,6 @@
<span {{ $attributes->class([
'badge',
'badge-success'=>($status === 'active'),
'badge-warning'=>($status === 'inactive'),
'badge-danger'=>($status === 'cancelled'),
])->except(['status','substatus']) }}>{{ $slot->isNotEmpty() ? $slot : strtoupper($status) }}</span> @if($slot->isEmpty() && (! in_array($status,['active','cancelled'])) && isset($substatus) && $substatus)<small>[{{ strtoupper($substatus) }}]</small> @endif

View File

@ -1,12 +0,0 @@
<!-- $o=Service::class -->
<span class="badge @if($o->isPending())badge-warning @else
@switch ($o->status)
@case('ACTIVE')
badge-success
@break;
@case('INACTIVE')
badge-danger
@break;
@endswitch
@endif
">{{ $o->status }}</span>