@php use Illuminate\Support\Str; use Illuminate\Support\Js; // Extract state from Filament ViewEntry $state = $getState(); $status = $state['status'] ?? 'success'; $warnings = $state['warnings'] ?? []; $settings = $state['settings'] ?? []; $settingsTable = $state['settings_table'] ?? null; $stringifyValue = function (mixed $value): string { if (is_null($value)) { return 'N/A'; } if (is_bool($value)) { return $value ? 'Enabled' : 'Disabled'; } if (is_scalar($value)) { return (string) $value; } if (is_array($value)) { return Js::from($value)->toHtml(); } if (is_object($value)) { if (method_exists($value, '__toString')) { return (string) $value; } return Js::from((array) $value)->toHtml(); } return 'N/A'; }; @endphp
{{-- Warnings --}} @if(!empty($warnings))
@foreach($warnings as $warning)
{{ $warning }}
@endforeach
@endif {{-- Settings Table (for Settings Catalog legacy format) --}} @if($settingsTable && !empty($settingsTable['rows'])) {{ count($settingsTable['rows']) }} {{ Str::plural('setting', count($settingsTable['rows'])) }}
@foreach($settingsTable['rows'] as $row)
{{ $row['definition'] ?? $row['label'] ?? $row['path'] ?? 'Setting' }}
@if(is_bool($row['value'])) {{ $row['value'] ? 'Enabled' : 'Disabled' }} @elseif(is_numeric($row['value'])) {{ $row['value'] }} @else {{ $row['value'] ?? 'N/A' }} @endif
@endforeach
@endif {{-- Settings Blocks (for OMA Settings, Key/Value pairs, etc.) --}} @foreach($settings as $block) @if($block['type'] === 'table') {{ count($block['rows'] ?? []) }} {{ Str::plural('item', count($block['rows'] ?? [])) }}
@foreach($block['rows'] ?? [] as $row)
{{ $row['label'] ?? $row['path'] ?? 'Setting' }} @if(!empty($row['description']))

{{ Str::limit($row['description'], 80) }}

@endif
@if(is_bool($row['value'])) {{ $row['value'] ? 'Enabled' : 'Disabled' }} @elseif(is_numeric($row['value'])) {{ $row['value'] }} @else {{ Str::limit($stringifyValue($row['value'] ?? null), 200) }} @endif
@endforeach
@elseif($block['type'] === 'keyValue') {{ count($block['entries'] ?? []) }} {{ Str::plural('entry', count($block['entries'] ?? [])) }}
@foreach($block['entries'] ?? [] as $entry)
{{ $entry['key'] }}
{{ Str::limit($stringifyValue($entry['value'] ?? null), 200) }}
@endforeach
@endif @endforeach {{-- Empty state --}} @if(empty($settings) && (!$settingsTable || empty($settingsTable['rows'])))

No settings data available

This policy may not contain settings, or they are in an unsupported format

@endif