@props([
    'anexos',
    'projetoId',
])

@if($anexos->isNotEmpty())
    <ul class="list-unstyled mb-0 small">
        @foreach($anexos as $anexo)
            <li class="mb-1 d-flex align-items-center gap-1 flex-wrap">
                <a href="{{ $anexo->public_url }}"
                    class="text-decoration-none"
                    target="_blank"
                    rel="noopener noreferrer"
                    title="{{ __('Visualizar anexo') }}: {{ $anexo->name }}">
                    <i class="fa-solid fa-paperclip me-1" aria-hidden="true"></i>
                    <span>{{ \Illuminate\Support\Str::limit($anexo->name, 40) }}</span>
                </a>
                <a href="{{ route('admin.projetosProgramas.anexos.download', [$projetoId, $anexo->id]) }}"
                    class="btn btn-outline-secondary btn-sm py-0 px-1"
                    title="{{ __('Baixar') }}: {{ $anexo->name }}"
                    aria-label="{{ __('Baixar') }}: {{ $anexo->name }}">
                    <i class="fa-solid fa-download" aria-hidden="true"></i>
                </a>
            </li>
        @endforeach
    </ul>
@else
    <span class="text-muted small">—</span>
@endif
