@props(['sms']) @php use App\Support\SmsDirection; $direction = SmsDirection::resolve($sms); $styles = match ($direction) { SmsDirection::SENT => ['bg' => '#dbeafe', 'color' => '#1d4ed8', 'label' => __('devices.sms.type_sent')], SmsDirection::RECEIVED => ['bg' => '#dcfce7', 'color' => '#15803d', 'label' => __('devices.sms.type_received')], default => ['bg' => '#f1f5f9', 'color' => '#475569', 'label' => __('devices.sms.type_unknown')], }; @endphp
merge(['class' => 'inline-flex items-center gap-1.5']) }} title="{{ $styles['label'] }}"> @if($direction === SmsDirection::SENT) @elseif($direction === SmsDirection::RECEIVED) @else ? @endif {{ $styles['label'] }}