{{-- Status pill of one SMS sendout (#2957 slice 5a, card #3019), used by the SMS list and the SMS detail. Expects: $smsSendout. Words are the sms.status keys the old list used; the colour follows DESIGN.md's status table. SMSSendout::statusType() returns 2 for a sendout that has not started and 1 for one that is sending, so 2 says "Schemalagd" and 1 says "Skickar" (the old list had the two words swapped). A sendout with status 0 and no abort time failed in the system; sms.status has no word for that (the old list printed the raw key), so it uses dashboard.sendout.failed. --}} @php $smsType = $smsSendout->statusType(); [$smsWord, $smsPill] = match (true) { $smsType === 2 => ['sms.status.scheduled', 'planned'], $smsType === 1 => ['sms.status.sending', 'running'], $smsType === 3 => ['sms.status.done', 'done'], $smsType === 0 && ! is_null($smsSendout->abort_time) => ['sms.status.aborted', 'stopped'], $smsType === 0 => ['dashboard.sendout.failed', 'stopped'], default => [null, null], }; @endphp @if ($smsWord){{ __($smsWord) }}@endif