@php $entries = $entries ?? []; $iconCheck = ''; $iconCross = ''; $iconDot = ''; @endphp
@if ($entries === [])
{{ __('No visit history found for this scheme.') }}
@else

{{ __('Visitation History Logs') }}

{{ __('Published monitoring visits, newest first') }}

@foreach ($entries as $entry) @php $statusKey = trim((string) ($entry['status_key'] ?? '')); if ($statusKey === '') { $status = (string) ($entry['status'] ?? ''); $statusKey = match ($status) { 'Satisfactory' => 'satisfactory', 'Unsatisfactory', 'Un-Satisfactory' => 'unsatisfactory', 'In Process' => 'in_process', default => 'neutral', }; } $markerIcon = match ($statusKey) { 'satisfactory' => $iconCheck, 'unsatisfactory' => $iconCross, default => $iconDot, }; $statusLabel = trim((string) ($entry['status'] ?? '')); $statusLabel = ($statusLabel !== '' && $statusLabel !== '—') ? $statusLabel : __('In Process'); $downloads = is_array($entry['downloads'] ?? null) ? $entry['downloads'] : []; @endphp
{!! $markerIcon !!}
{{ __('Visit Date') }} {{ $entry['visit_date_display'] ?? '—' }}
{{ __('Published Date') }} {{ $entry['published_date_display'] ?? '—' }}
{{ __('Reporting Officer') }} {{ $entry['reporting_officer'] ?? '—' }}
{{ $entry['frequency_label'] ?? '—' }}
{{ $entry['data_source'] ?? '—' }}
{{ $statusLabel }}
{{ __('Location') }} {{ $entry['location'] ?? '—' }}
{{ __('Compliance Status') }} {{ $entry['compliance_status'] ?? '—' }}
@if (! empty($downloads['compliance']['url']) || ! empty($downloads['published_report']['url']))
@if (! empty($downloads['compliance']['url'])) {{ __('Compliance Replies') }} @endif @if (! empty($downloads['published_report']['url'])) {{ __('Published Monitoring Report') }} @endif
@endif
@endforeach
@endif