{{-- Müşteri kartı → Dökümanlar sekmesi. Sürükle-bırak yükleme + klasik tablo düzeninde belge listesi. Operasyonda üretilen yolcu belgeleri ayrı tabloda listelenir. Beklenen: $customer, $documentTypes --}} @include('agency.partials.qv-table') @php $docs = $customer->customerDocuments->sortByDesc('created_at'); $today = \Carbon\Carbon::today(); $fmtSize = function ($bytes) { $bytes = (int) $bytes; if ($bytes <= 0) return '—'; $u = ['B', 'KB', 'MB', 'GB']; $i = (int) floor(log($bytes, 1024)); $i = min($i, count($u) - 1); return round($bytes / (1024 ** $i), $i ? 1 : 0) . ' ' . $u[$i]; }; $iconFor = function ($mime, $name) { $ext = strtolower(pathinfo((string) $name, PATHINFO_EXTENSION)); return match (true) { str_contains((string) $mime, 'pdf') || $ext === 'pdf' => ['fa-file-pdf', '#dc2626'], str_contains((string) $mime, 'image') || in_array($ext, ['jpg','jpeg','png','webp','gif']) => ['fa-file-image', '#0ea5e9'], in_array($ext, ['xls','xlsx','csv']) => ['fa-file-excel', '#16a34a'], in_array($ext, ['doc','docx']) => ['fa-file-word', '#2563eb'], in_array($ext, ['zip','rar','7z']) => ['fa-file-zipper', '#a855f7'], default => ['fa-file-lines', '#64748b'], }; }; @endphp