<div class="d-flex align-items-end flex-wrap">
    <a href="{{ $route }}?{{queryLineExcept(['sort_by', 'sort_dir'])}}&sort_by={{$key}}&sort_dir={{request()->input('sort_by') === $key && request()->input('sort_dir') === 'ASC' ? 'DESC' : 'ASC'}}" class="text-decoration-none">
        <b class="{{request()->input('sort_by') === $key ? 'text-primary' : 'text-secondary'}}">{!! $label !!}</b>
        <span class="d-inline-flex align-items-baseline">
            @if(request()->input('sort_by') !== $key)
                <i class="ml-1 text-sm fa fa-chevron-down on-hover-opaque text-secondary"></i>
            @else
                @if(request()->input('sort_dir') === 'DESC')
                    <i class="ml-1 text-sm fa fa-chevron-up"></i>
                @else
                    <i class="ml-1 text-sm fa fa-chevron-down"></i>
                @endif
            @endif
        </span>
    </a>
    @if(request()->input('sort_by') === $key)
        <a href="{{ $route }}?{{queryLineExcept(['sort_by', 'sort_dir'])}}" class="text-sm on-hover-opaque text-secondary ml-1">
            <i class="fa fa-times"></i>
        </a>
    @endif
</div>