{{-- Colored project status pill (green/yellow/red from the latest status update). Expects: $status: string|null - green|yellow|red (null = no update yet) $date: \Carbon\CarbonImmutable|null - when the status was posted (optional) --}} @php $pillColors = [ 'green' => 'var(--green)', 'yellow' => 'var(--yellow)', 'red' => 'var(--red)', ]; $pillLabels = [ 'green' => __('label.status_on_track'), 'yellow' => __('label.status_at_risk'), 'red' => __('label.status_off_track'), ]; @endphp @if (!empty($status) && isset($pillColors[$status])) {{ $pillLabels[$status] }} @if (!empty($date)) ยท {{ $date->formatDateForUser() }} @endif @else {{ __('label.status_no_update') }} @endif