@php
    $extensoesImagem = ['jpg', 'jpeg', 'png', 'gif'];
    $extensao = pathinfo($asset, PATHINFO_EXTENSION);
@endphp
@if (in_array(strtolower($extensao), $extensoesImagem))
<button type="button" style="border: 0; background" class="btn" data-bs-toggle="modal" data-bs-target="#open_{{ $index }}">
    <img src="{{ asset($asset) }}" alt="Comprovante" class="img-fluid rounded-2" width="90px">
</button>
<div class="modal fade" id="open_{{ $index }}" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-fullscreen">
        <div class="modal-content">
            <div class="modal-header">
                <h1 class="modal-title fs-5" id="exampleModalLabel">{{ $text }}</h1>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
            </div>
            <div class="modal-body">
                <img src="{{ asset($asset) }}" title="{{ $title }}" alt="{{ $title }}" class="img-fluid rounded-2">
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Fechar</button>
            </div>
        </div>
    </div>
</div>
@elseif (strtolower($extensao) === 'pdf')
    <a href="{{ asset($asset) }}" class="text-primary" target="_blank" download><i class="fa-solid fa-download"></i> Baixar PDF</a>
@else
    <span class="text-muted">Arquivo não suportado</span>
@endif