@php use App\Models\PC\Pcn\ProjectConceptNote; use App\Support\ReportRichTextHtml; $empty = '—'; $plain = static function ($value) use ($empty): string { $text = trim((string) ($value ?? '')); return $text !== '' ? display_text($text) : $empty; }; $rich = static function ($value) use ($empty): string { if (! ReportRichTextHtml::hasVisibleContent($value)) { return $empty; } return ReportRichTextHtml::display($value); }; $date = static function ($value) use ($empty): string { if ($value instanceof \DateTimeInterface) { return $value->format('d M Y'); } $text = trim((string) ($value ?? '')); return $text !== '' ? display_text($text) : $empty; }; $money = static function ($value) use ($empty, $plain): string { if ($value === null || $value === '') { return $empty; } return $plain(number_format((float) $value, 2)); }; $riskLabel = static function ($value) use ($plain): string { $map = [ '1-High Risk' => '1 - High Risk', '2-Medium Risk' => '2 - Medium Risk', '3-Low Risk' => '3 - Low Risk', ]; $key = trim((string) ($value ?? '')); if ($key === '') { return '—'; } return $plain($map[$key] ?? $key); }; $stateLabel = $stateLabel ?? ucfirst(str_replace('_', ' ', (string) ($record->state ?? 'draft'))); $budgetMap = collect($record->budgetLines ?? [])->keyBy('line_type'); $econBenefits = array_filter((array) ($record->econ_benefits ?? [])); $pcnUid = $record instanceof ProjectConceptNote ? ($record->pcn_uid ?? '') : ''; $previewMode = ! empty($previewMode); $showWorkflowTab = ! $previewMode && ! ($isDraft ?? false); @endphp

@if (trim((string) $pcnUid) !== '') Ref-no: {{ display_text($pcnUid) }}   @endif State: {{ display_text($stateLabel) }}   Created: {{ $date($record->created_at) }}

@if ($showWorkflowTab)
@include('project-concept-notes.partials.show-modal.page-1-basic') @include('project-concept-notes.partials.show-modal.page-2-background') @include('project-concept-notes.partials.show-modal.page-3-objectives') @include('project-concept-notes.partials.show-modal.page-4-framework') @include('project-concept-notes.partials.show-modal.page-5-cost-risks') @include('project-concept-notes.partials.show-modal.page-6-annexures') @include('project-concept-notes.partials.show-modal.page-7-signatures')
@include('project-concept-notes.partials.workflow-timeline')
@include('project-concept-notes.partials.show-modal.nav-footer', ['navClass' => 'pcn-details-page-nav']) @else
@include('project-concept-notes.partials.show-modal.page-1-basic') @include('project-concept-notes.partials.show-modal.page-2-background') @include('project-concept-notes.partials.show-modal.page-3-objectives') @include('project-concept-notes.partials.show-modal.page-4-framework') @include('project-concept-notes.partials.show-modal.page-5-cost-risks') @include('project-concept-notes.partials.show-modal.page-6-annexures') @include('project-concept-notes.partials.show-modal.page-7-signatures')
@if (! $previewMode) @include('project-concept-notes.partials.show-modal.nav-footer') @endif
@endif