{{-- Rich text + Attachment/Annexure block for PC-III inline fields. Expects: $fieldName, $value, $filesEdit, $attFieldName, $annFieldName, $uid, $existingAttachmentsMap, $pcForm, optional $label, $placeholder, $rows, $readonly --}} @php $pciTfMap = $existingAttachmentsMap ?? []; $pciTfAttKey = (string) $attFieldName; $pciTfAnnKey = (string) $annFieldName; $pciTfAttRows = []; $pciTfAnnRows = []; if (! empty($pciTfMap[$pciTfAttKey]) && is_array($pciTfMap[$pciTfAttKey])) { foreach ($pciTfMap[$pciTfAttKey] as $f) { if (empty($f['path'])) { continue; } $pciTfAttRows[] = ['path' => $f['path'], 'title' => $f['name'] ?? basename((string) $f['path'])]; } } if (! empty($pciTfMap[$pciTfAnnKey]) && is_array($pciTfMap[$pciTfAnnKey])) { foreach ($pciTfMap[$pciTfAnnKey] as $f) { if (empty($f['path'])) { continue; } $pciTfAnnRows[] = ['path' => $f['path'], 'title' => $f['name'] ?? basename((string) $f['path'])]; } } @endphp @include('pc-forms.partials.pci-textarea-map-files', [ 'filesEdit' => (bool) ($filesEdit ?? false), 'attachmentRows' => $pciTfAttRows, 'annexureRows' => $pciTfAnnRows, 'attFieldName' => $attFieldName, 'annFieldName' => $annFieldName, 'uid' => $uid, 'pcForm' => $pcForm ?? null, ])