@if ($paginator->hasPages())
    <nav role="navigation" aria-label="Pagination" class="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between text-sm">
        <div class="text-xs text-gray-400">
            Showing
            <span class="font-semibold text-gray-200">{{ $paginator->firstItem() }}</span>
            to
            <span class="font-semibold text-gray-200">{{ $paginator->lastItem() }}</span>
            of
            <span class="font-semibold text-gray-200">{{ $paginator->total() }}</span>
            results
        </div>

        <div class="flex items-center gap-2">
            @if ($paginator->onFirstPage())
                <span class="rounded-full border border-white/10 px-3 py-1 text-xs text-gray-500">Prev</span>
            @else
                <a href="{{ $paginator->previousPageUrl() }}" class="rounded-full border border-white/10 px-3 py-1 text-xs text-gray-200 hover:bg-white/5">Prev</a>
            @endif

            @foreach ($elements as $element)
                @if (is_string($element))
                    <span class="px-2 text-gray-500">{{ $element }}</span>
                @endif

                @if (is_array($element))
                    @foreach ($element as $page => $url)
                        @if ($page == $paginator->currentPage())
                            <span class="rounded-full bg-white/10 px-3 py-1 text-xs font-semibold text-white">{{ $page }}</span>
                        @else
                            <a href="{{ $url }}" class="rounded-full border border-white/10 px-3 py-1 text-xs text-gray-200 hover:bg-white/5">{{ $page }}</a>
                        @endif
                    @endforeach
                @endif
            @endforeach

            @if ($paginator->hasMorePages())
                <a href="{{ $paginator->nextPageUrl() }}" class="rounded-full border border-white/10 px-3 py-1 text-xs text-gray-200 hover:bg-white/5">Next</a>
            @else
                <span class="rounded-full border border-white/10 px-3 py-1 text-xs text-gray-500">Next</span>
            @endif
        </div>
    </nav>
@endif
