@if (isset($permission) && auth()->user()->getPermissaoDetalhes($permission)['editar'])
    @php
        $editUrl = route($route, $id);
        $params = [];
        if (!empty($queryParams)) {
            $params = $queryParams;
        } else {
            if (request()->filled('q')) {
                $params['q'] = request()->input('q');
            }
            if (request()->filled('page')) {
                $params['page'] = request()->input('page');
            }
        }
        $params['return_url'] = url()->full();
        if (!empty($params)) {
            $editUrl .= (str_contains($editUrl, '?') ? '&' : '?') . http_build_query($params);
        }
    @endphp
    <a href="{{ $editUrl }}" class="btn btn-sm btn-warning" title="{{ $title }}">
        @if($fontawesome == null)
            <i class="fa-solid fa-pen-to-square"></i>
        @else
            {!! $fontawesome !!}
        @endif
    </a>
@endif
