@php use App\Support\Badges\BadgeDomain; use App\Support\Badges\BadgeRenderer; use Illuminate\Support\Carbon; $rows = isset($rows) ? $rows : (isset($getState) ? $getState() : []); $rows = is_array($rows) ? $rows : []; $formatTimestamp = static function (?string $value): string { if (! is_string($value) || trim($value) === '') { return '—'; } try { return Carbon::parse($value)->toDayDateTimeString(); } catch (\Throwable) { return $value; } }; @endphp
@if ($rows === [])
No captured policy types are available in this snapshot.
@else
@foreach ($rows as $row) @php $fidelitySpec = BadgeRenderer::spec(BadgeDomain::BaselineSnapshotFidelity, $row['fidelity'] ?? null); $gapState = (($row['gapCount'] ?? 0) > 0) ? 'gaps_present' : 'clear'; $gapSpec = BadgeRenderer::spec(BadgeDomain::BaselineSnapshotGapStatus, $gapState); @endphp @endforeach
Policy type Items Fidelity Coverage state Latest evidence Notes
{{ $row['label'] ?? ($row['policyType'] ?? 'Policy type') }} {{ (int) ($row['itemCount'] ?? 0) }} {{ $fidelitySpec->label }}
{{ $gapSpec->label }} {{ (int) ($row['gapCount'] ?? 0) }}
{{ $formatTimestamp($row['capturedAt'] ?? null) }} {{ $row['coverageHint'] ?? '—' }}
@endif