@php $runs = $runs ?? collect(); $overflowCount = (int) ($overflowCount ?? 0); $tenant = $tenant ?? null; @endphp {{-- Cleanup is delegated to the shared poller helper, which uses teardownObserver and new MutationObserver. --}} {{-- Widget must always be mounted, even when empty, so it can receive Livewire events --}}
@if($runs->isNotEmpty())
@foreach ($runs->take(5) as $run) @php $statusSpec = \App\Support\Badges\BadgeRenderer::spec( \App\Support\Badges\BadgeDomain::OperationRunStatus, [ 'status' => (string) $run->status, 'freshness_state' => $run->freshnessState()->value, ], ); $lifecycleAttention = \App\Support\OpsUx\OperationUxPresenter::lifecycleAttentionSummary($run); $guidance = \App\Support\OpsUx\OperationUxPresenter::surfaceGuidance($run); @endphp

{{ \App\Support\OperationCatalog::label((string) $run->type) }}

@if($run->status === 'queued') Queued • {{ ($run->started_at ?? $run->created_at)?->diffForHumans(null, true, true) }} @else Running • {{ ($run->started_at ?? $run->created_at)?->diffForHumans(null, true, true) }} @endif

{{ $statusSpec->label }} @if ($lifecycleAttention) {{ $lifecycleAttention }} @endif
@if ($guidance)

{{ $guidance }}

@endif
@if ($tenant) Open operation @endif
@endforeach @if($overflowCount > 0 && $tenant) +{{ $overflowCount }} more @endif
@endif