@foreach ($issue['attachments'] as $att)
@php
$ext = strtolower(pathinfo($att['filename'], PATHINFO_EXTENSION));
$icon = match(true) {
in_array($ext, ['jpg','jpeg','png','gif','webp','svg']) => 'bi-file-image-fill text-success',
in_array($ext, ['pdf']) => 'bi-file-pdf-fill text-danger',
in_array($ext, ['doc','docx']) => 'bi-file-word-fill text-primary',
in_array($ext, ['xls','xlsx','csv']) => 'bi-file-excel-fill text-success',
in_array($ext, ['ppt','pptx']) => 'bi-file-ppt-fill text-warning',
in_array($ext, ['zip','rar','7z','tar','gz']) => 'bi-file-zip-fill text-secondary',
in_array($ext, ['mp4','mov','avi','mkv']) => 'bi-file-play-fill text-purple',
default => 'bi-file-earmark-fill text-secondary',
};
$kb = round($att['filesize'] / 1024, 1);
$size = $kb >= 1024 ? round($kb / 1024, 1) . ' MB' : $kb . ' KB';
@endphp
@endforeach