@props([
'title' => null,
'lastDeploymentLink' => null,
'resource' => null,
'showRefreshButton' => true,
])
@php
$stoppedAfterRestartLimit = $resource && method_exists($resource, 'stoppedAfterRestartLimit') && $resource->stoppedAfterRestartLimit();
@endphp
@if (str($resource->status)->startsWith('running'))
@elseif(str($resource->status)->startsWith('degraded'))
@elseif(str($resource->status)->startsWith('restarting') || str($resource->status)->startsWith('starting'))
@else
@endif
@if (isset($resource->restart_count) && $resource->restart_count > 0 && (!str($resource->status)->startsWith('exited') || $stoppedAfterRestartLimit))
({{ $resource->restart_count }}x restarts)
@endif
@if ($stoppedAfterRestartLimit)
Stopped after reaching restart limit ({{ $resource->restart_count }}/{{ $resource->max_restart_count }}).
@endif
@if (!str($resource->status)->contains('exited') && $showRefreshButton)
@endif