@php
    $tabKey = $ppTabQueryKey ?? 'tab';
    $query = request()->except(['sort_by', 'sort_dir', 'page']);
    $query[$tabKey] = request($tabKey, 'projetos');
    $isActive = request('sort_by') === $column;
    $curDir = request('sort_dir', 'asc');
    $nextDir = $isActive && $curDir === 'asc' ? 'desc' : 'asc';
    $query['sort_by'] = $column;
    $query['sort_dir'] = $nextDir;
    $href = route($ppModuleRoute ?? 'admin.projetosProgramas.index', $query);
@endphp
<a href="{{ $href }}"
    class="pp-th-sort-link text-decoration-none text-dark">
    <span class="pp-th-sort-label">{{ $label }}</span>
    @if($isActive)
        <span class="pp-th-sort-icon text-body" aria-hidden="true"><i class="fa fa-sort-{{ $curDir === 'asc' ? 'up' : 'down' }}"></i></span>
        <span class="visually-hidden">{{ $curDir === 'asc' ? __('Ordenar decrescente') : __('Ordenar crescente') }}</span>
    @else
        <span class="pp-th-sort-icon text-muted" aria-hidden="true"><i class="fa fa-sort"></i></span>
        <span class="visually-hidden">{{ __('Ordenar') }}</span>
    @endif
</a>
