@if (!isset($permission) || auth()->user()->getPermissaoDetalhes($permission)['visualizar'])
    @php
        $navUrl = $link ?? route($route, $id);
        if (!empty($queryParams)) {
            $navUrl .= (str_contains($navUrl, '?') ? '&' : '?') . http_build_query($queryParams);
        } elseif (request()->filled('q')) {
            $navUrl .= (str_contains($navUrl, '?') ? '&' : '?') . 'q=' . urlencode(request()->input('q'));
        }
    @endphp
    <a href="{{ $navUrl }}" class="btn btn-sm btn-warning" title="{{ $title }}" target="{{ $target ?? '_self' }}">
        @if($fontawesome == null)
            <i class="fa-solid fa-pen-to-square"></i>
        @else
            {!! $fontawesome !!}
        @endif
    </a>
@endif
