@php use App\Support\Badges\BadgeDomain; use App\Support\Badges\BadgeRenderer; use Illuminate\Support\Carbon; $groups = $getState() ?? []; $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 ($groups === [])
No snapshot items were captured for this baseline snapshot.
@else @foreach ($groups as $group) @php $fidelitySpec = BadgeRenderer::spec(BadgeDomain::BaselineSnapshotFidelity, $group['fidelity'] ?? null); $gapSpec = BadgeRenderer::spec(BadgeDomain::BaselineSnapshotGapStatus, data_get($group, 'gapSummary.badge_state')); $messages = data_get($group, 'gapSummary.messages', []); @endphp
{{ (int) ($group['itemCount'] ?? 0) }} {{ \Illuminate\Support\Str::plural('item', (int) ($group['itemCount'] ?? 0)) }} {{ $fidelitySpec->label }} {{ $gapSpec->label }}
@if (! empty($group['renderingError']))
{{ $group['renderingError'] }}
@endif @if (is_array($messages) && $messages !== [])
Gap details
    @foreach ($messages as $message)
  • {{ $message }}
  • @endforeach
@endif
@foreach (($group['items'] ?? []) as $item) @php $itemFidelitySpec = BadgeRenderer::spec(BadgeDomain::BaselineSnapshotFidelity, $item['fidelity'] ?? null); $itemGapSpec = BadgeRenderer::spec(BadgeDomain::BaselineSnapshotGapStatus, data_get($item, 'gapSummary.badge_state')); @endphp
{{ $item['label'] ?? 'Snapshot item' }}
{{ $item['typeLabel'] ?? 'Policy type' }}
{{ $item['referenceStatus'] ?? 'Captured metadata' }} {{ $itemFidelitySpec->label }} {{ $itemGapSpec->label }}
Identity
{{ $item['identityHint'] ?? '—' }}
Observed
{{ $formatTimestamp($item['observedAt'] ?? null) }}
Source reference
{{ $item['sourceReference'] ?? '—' }}
@if (is_array(data_get($item, 'gapSummary.messages')) && data_get($item, 'gapSummary.messages') !== [])
{{ implode(' ', data_get($item, 'gapSummary.messages', [])) }}
@endif @if (($item['structuredAttributes'] ?? []) !== [])
@foreach (($item['structuredAttributes'] ?? []) as $attribute)
{{ $attribute['label'] ?? 'Attribute' }}
{{ $attribute['value'] ?? '—' }}
@endforeach
@endif
@endforeach
@endforeach @endif