Files
ilycats/resources/views/components/status-badge.blade.php
T
2026-09-23 12:45:02 +07:00

17 lines
599 B
PHP

@props(['status'])
@php
$cleanStatus = strtolower(trim($status ?? ''));
$safeWords = ['sehat', 'normal', 'aktif', 'ok', 'good', 'sembuh', '-', ''];
$isSehat = in_array($cleanStatus, $safeWords);
$classes = $isSehat
? 'bg-green-100 text-green-700 border-green-200'
: 'bg-red-100 text-red-700 border-red-200';
@endphp
<span {{ $attributes->merge(['class' => "px-3 py-1 rounded-full text-xs font-bold border $classes"]) }}>
<i class="fas {{ $isSehat ? 'fa-check-circle' : 'fa-pills' }} mr-1"></i>
{{ $isSehat ? 'Sehat / Normal' : $status }}
</span>