@php $preview = $getState() ?? []; $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