69 lines
3.2 KiB
PHP
69 lines
3.2 KiB
PHP
@php
|
|
$normalized = $getState() ?? [];
|
|
$warnings = $normalized['warnings'] ?? [];
|
|
$settings = $normalized['settings'] ?? [];
|
|
@endphp
|
|
|
|
<div class="space-y-3">
|
|
<div class="text-sm font-semibold text-gray-800">Normalized settings</div>
|
|
@if (! empty($warnings))
|
|
<div class="rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-800">
|
|
<div class="font-semibold">Warnings</div>
|
|
<ul class="mt-1 list-disc space-y-1 pl-5">
|
|
@foreach ($warnings as $warning)
|
|
<li>{{ $warning }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endif
|
|
|
|
@if (empty($settings))
|
|
<p class="text-sm text-gray-600">No settings available.</p>
|
|
@endif
|
|
|
|
@foreach ($settings as $block)
|
|
<div class="space-y-2 rounded-md border border-gray-200 bg-white p-3 shadow-sm">
|
|
<div class="text-sm font-semibold text-gray-800">{{ $block['title'] ?? 'Settings' }}</div>
|
|
|
|
@if (($block['type'] ?? 'keyValue') === 'table')
|
|
<div class="overflow-x-auto">
|
|
<table class="w-full text-left text-sm">
|
|
<thead class="bg-gray-50 text-gray-700">
|
|
<tr>
|
|
<th class="px-3 py-2">Path</th>
|
|
<th class="px-3 py-2">Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-gray-100">
|
|
@foreach ($block['rows'] ?? [] as $row)
|
|
<tr>
|
|
<td class="px-3 py-2 align-top">
|
|
<div class="font-medium text-gray-800">{{ $row['path'] ?? '-' }}</div>
|
|
@if (! empty($row['label']))
|
|
<div class="text-xs text-gray-600">{{ $row['label'] }}</div>
|
|
@endif
|
|
</td>
|
|
<td class="px-3 py-2 align-top text-gray-800">
|
|
{{ is_array($row['value'] ?? null) ? json_encode($row['value'], JSON_PRETTY_PRINT) : ($row['value'] ?? '-') }}
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@else
|
|
<dl class="grid grid-cols-1 gap-3 sm:grid-cols-2">
|
|
@foreach ($block['entries'] ?? [] as $entry)
|
|
<div class="rounded border border-gray-100 bg-gray-50 p-3">
|
|
<dt class="text-xs uppercase tracking-wide text-gray-500">{{ $entry['key'] ?? '-' }}</dt>
|
|
<dd class="whitespace-pre-wrap text-sm text-gray-800">
|
|
{{ is_array($entry['value'] ?? null) ? json_encode($entry['value'], JSON_PRETTY_PRINT) : ($entry['value'] ?? '-') }}
|
|
</dd>
|
|
</div>
|
|
@endforeach
|
|
</dl>
|
|
@endif
|
|
</div>
|
|
@endforeach
|
|
</div>
|