TenantAtlas/resources/views/filament/infolists/entries/snapshot-json.blade.php
2025-12-14 20:23:18 +01:00

27 lines
1.4 KiB
PHP

@php
// Obtain state from Filament infolist entry
$payload = $getState();
// Normalize payload to array for the JSON viewer
$payloadArray = is_string($payload) ? (json_decode($payload, true) ?? []) : ($payload ?? []);
// Provide the small set of helpers the pepperfm json view expects
$getState = fn () => $payloadArray;
$getCharacterLimit = fn () => null;
$getAsModal = fn () => false;
$getAsDrawer = fn () => false;
$getKeyColumnLabel = fn () => 'Key';
$getValueColumnLabel = fn () => 'Value';
$getButtonConfig = fn () => (object) ['id' => 'fj-modal', 'icon' => null, 'iconColor' => null, 'alignment' => null, 'width' => null, 'closeByClickingAway' => true, 'closedByEscaping' => true, 'closedButton' => true, 'label' => null, 'tooltip' => null, 'size' => null, 'href' => null, 'tag' => null, 'color' => null];
$getModalConfig = fn () => (object) ['id' => 'fj-modal', 'icon' => null, 'iconColor' => null, 'alignment' => null, 'width' => null, 'closeByClickingAway' => true, 'closedByEscaping' => true, 'closedButton' => true];
$getRenderMode = fn () => \PepperFM\FilamentJson\Enums\RenderModeEnum::Tree;
$getInitiallyCollapsed = fn () => 1;
$getExpandAllToggle = fn () => false;
$getCopyJsonAction = fn () => true;
$getMaxDepth = fn () => 3;
$applyLimit = fn ($v) => $v;
@endphp
{{-- Render pepperfm filament-json viewer --}}
@include('filament-json::json')