@props([ 'status' => 'Running', 'title' => null, 'lastDeploymentLink' => null, 'noLoading' => false, ]) @php // Handle both colon format (backend) and parentheses format (from services.blade.php) // running:healthy → Running (healthy) // running (healthy) → running (healthy) (already formatted, display as-is) if (str($status)->contains('(')) { // Already in parentheses format from services.blade.php - use as-is $displayStatus = $status; $healthStatus = str($status)->after('(')->before(')')->trim()->value(); } elseif (str($status)->contains(':') && !str($status)->startsWith('Proxy')) { // Colon format from backend - transform it $parts = explode(':', $status); $displayStatus = str($parts[0])->headline(); $healthStatus = $parts[1] ?? null; } else { // Simple status without health $displayStatus = str($status)->headline(); $healthStatus = null; } @endphp
@if ($lastDeploymentLink) {{ $displayStatus }} @else {{ $displayStatus }} @endif
@if ($healthStatus && !str($displayStatus)->contains('('))
({{ $healthStatus }})
@endif @php $showUnknownHelper = !str($status)->startsWith('Proxy') && (str($status)->contains('unknown') || str($healthStatus)->contains('unknown')); $showUnhealthyHelper = !str($status)->startsWith('Proxy') && (str($status)->contains('unhealthy') || str($healthStatus)->contains('unhealthy')); @endphp @if ($showUnknownHelper)
@endif @if ($showUnhealthyHelper)
@endif