@php $summary = is_array($summary ?? null) ? $summary : []; $buckets = is_array($buckets ?? null) ? $buckets : []; $detailState = is_string($summary['detail_state'] ?? null) ? $summary['detail_state'] : 'no_gaps'; $tableContext = is_string($searchId ?? null) && $searchId !== '' ? $searchId : 'evidence-gap-search'; @endphp @if ($detailState === 'details_not_recorded' && $buckets === [])
{{ __('baseline-compare.evidence_gap_missing_details_title') }}

{{ __('baseline-compare.evidence_gap_missing_details_body') }}

@elseif ($buckets !== [])
@if ($detailState === 'details_not_recorded')
{{ __('baseline-compare.evidence_gap_missing_details_title') }}

{{ __('baseline-compare.evidence_gap_missing_details_body') }}

@endif
@foreach ($buckets as $bucket) @php $reasonLabel = is_string($bucket['reason_label'] ?? null) ? $bucket['reason_label'] : 'Evidence gap'; $count = is_numeric($bucket['count'] ?? null) ? (int) $bucket['count'] : 0; $recordedCount = is_numeric($bucket['recorded_count'] ?? null) ? (int) $bucket['recorded_count'] : 0; $missingDetailCount = is_numeric($bucket['missing_detail_count'] ?? null) ? (int) $bucket['missing_detail_count'] : 0; @endphp

{{ $reasonLabel }}

{{ __('baseline-compare.evidence_gap_bucket_help') }}

{{ __('baseline-compare.evidence_gap_reason_affected', ['count' => $count]) }} {{ __('baseline-compare.evidence_gap_reason_recorded', ['count' => $recordedCount]) }} @if ($missingDetailCount > 0) {{ __('baseline-compare.evidence_gap_reason_missing_detail', ['count' => $missingDetailCount]) }} @endif
@if ($missingDetailCount > 0)
{{ __('baseline-compare.evidence_gap_missing_reason_body', ['count' => $missingDetailCount]) }}
@endif
@endforeach

{{ __('baseline-compare.evidence_gap_search_label') }}

{{ __('baseline-compare.evidence_gap_search_help') }}

@livewire( \App\Livewire\BaselineCompareEvidenceGapTable::class, [ 'buckets' => $buckets, 'context' => $tableContext, ], key('baseline-compare-evidence-gap-table-'.$tableContext) )
@endif