@php $noteSheet = $noteSheet ?? []; $entries = is_array($noteSheet['entries'] ?? null) ? $noteSheet['entries'] : []; $title = trim((string) ($noteSheet['title'] ?? '')); $documentLabel = trim((string) ($noteSheet['document_label'] ?? '')); $showDocumentBadges = (bool) ($noteSheet['show_document_badges'] ?? false); @endphp
@if ($title !== '')

{{ display_text($title) }}

@endif @if ($documentLabel !== '')

{{ display_text($documentLabel) }} · {{ __('Workflow Note Sheet') }}

@endif @if ($entries === [])

{{ $emptyMessage ?? __('No workflow history yet.') }}

@else
@foreach ($entries as $entry) @php $sequence = (int) ($entry['sequence'] ?? 0); $signatoryName = trim((string) ($entry['signatory_name'] ?? '')); $signatoryDesignation = trim((string) ($entry['signatory_designation'] ?? '')); $actionDate = trim((string) ($entry['action_date'] ?? '')); $signatureUrl = trim((string) ($entry['signature_url'] ?? '')); $entryDocumentLabel = trim((string) ($entry['document_label'] ?? '')); $actionChip = trim((string) ($entry['action_chip'] ?? '')); $showBadges = $showDocumentBadges && ($entryDocumentLabel !== '' || $actionChip !== ''); $showSignatureBlock = $signatureUrl !== '' || ($signatoryName !== '' && $signatoryName !== '—') || $signatoryDesignation !== '' || ($actionDate !== '' && $actionDate !== '—'); @endphp
@if ($showBadges)
@if ($entryDocumentLabel !== '') {{ display_text($entryDocumentLabel) }} @endif @if ($actionChip !== '') {{ display_text($actionChip) }} @endif
@endif
{{ $sequence }})
{!! $entry['body_html'] ?? '' !!}
@if ($showSignatureBlock)
@if ($signatureUrl !== '')
{{ __('Signature') }}
@endif @if ($signatoryName !== '' && $signatoryName !== '—')
{{ display_text($signatoryName) }}
@endif @if ($signatoryDesignation !== '')
{{ display_text($signatoryDesignation) }}
@endif @if ($actionDate !== '' && $actionDate !== '—')
{{ display_text($actionDate) }}
@endif
@endif
@endforeach
@endif