@php $state = $getState() ?? []; $state = is_array($state) ? $state : []; $preview = is_array($state['preview'] ?? null) ? $state['preview'] : $state; $previewIntegrity = is_array($state['previewIntegrity'] ?? null) ? $state['previewIntegrity'] : []; $checksIntegrity = is_array($state['checksIntegrity'] ?? null) ? $state['checksIntegrity'] : []; $executionSafetySnapshot = is_array($state['executionSafetySnapshot'] ?? null) ? $state['executionSafetySnapshot'] : []; $scopeBasis = is_array($state['scopeBasis'] ?? null) ? $state['scopeBasis'] : []; $integritySpec = \App\Support\Badges\BadgeRenderer::spec( \App\Support\Badges\BadgeDomain::RestorePreviewDecision, $previewIntegrity['state'] ?? 'not_generated' ); $checksSpec = \App\Support\Badges\BadgeRenderer::spec( \App\Support\Badges\BadgeDomain::RestoreCheckSeverity, $checksIntegrity['state'] ?? 'not_run' ); $recoveryBoundary = \App\Support\RestoreSafety\RestoreSafetyCopy::recoveryBoundary( is_string($executionSafetySnapshot['follow_up_boundary'] ?? null) ? $executionSafetySnapshot['follow_up_boundary'] : 'preview_only_no_execution_proven' ); $actionPresentation = static function (array $item): array { $action = is_string($item['action'] ?? null) ? $item['action'] : null; return match ($action) { 'create' => ['label' => 'Will create', 'color' => 'success'], 'update' => ['label' => 'Will update existing', 'color' => 'info'], default => ['label' => \Illuminate\Support\Str::headline((string) ($action ?? 'action')), 'color' => 'gray'], }; }; $foundationItems = collect($preview)->filter(function ($item) { return is_array($item) && array_key_exists('decision', $item) && array_key_exists('sourceId', $item); }); $policyItems = collect($preview)->reject(function ($item) { return is_array($item) && array_key_exists('decision', $item) && array_key_exists('sourceId', $item); }); @endphp @if (empty($preview))
No preview has been generated yet.
@else