@if ($paginator->hasPages())
    <nav aria-label="Blog Pagination">
        <ul class="flex gap-10 items-center flex-wrap justify-center pagination mt10">

            @if ($paginator->onFirstPage())
                <li class="page-item disabled">
                    <span class="page-link dark:text-white h-45 w-25 flex items-center justify-center text-xl prev"><i class="fas fa-chevron-left"></i></span>
                </li>
            @else
                <li class="page-item">
                    <a class="page-link dark:text-white h-45 w-25 flex items-center justify-center text-xl prev" href="{{ $paginator->previousPageUrl() }}"><i class="fas fa-chevron-left"></i></a>
                </li>
            @endif

            {{-- Pagination Elements --}}
            @foreach ($elements as $element)
                {{-- "Three Dots" Separator --}}
                @if (is_string($element))
                    <li class="page-item disabled"><span class="page-link">{{ $element }}</span></li>
                @endif

                {{-- Array Of Links --}}
                @if (is_array($element))
                    @foreach ($element as $page => $url)
                        @if ($page == $paginator->currentPage())
                            <li class="page-item active"><a class="page-link size-45 flex border border-2 border-heading bg-secondary dark:bg-white rounded-full items-center justify-center text-xl text-white dark:text-secondary" href="javascript:void(0);"><span>{{ $page }}</span></a></li>
                        @else
                            <li class="page-item"><a class="page-link size-45 flex border border-2 border-secondary dark:border-white rounded-full items-center justify-center text-secondary dark:text-white text-xl" href="{{ $url }}"><span>{{ $page }}</span></a></li>
                        @endif
                    @endforeach
                @endif
            @endforeach

            {{-- Next Page Link --}}
            @if ($paginator->hasMorePages())
                <li class="page-item">
                    <a class="page-link dark:text-white h-45 w-25 flex items-center justify-center text-xl next" href="{{ $paginator->nextPageUrl() }}"><i class="fas fa-chevron-right"></i></a>
                </li>
            @else
                <li class="page-item disabled">
                    <span class="page-link dark:text-white page-link h-45 w-25 flex items-center justify-center text-xl next"><i class="fas fa-chevron-right"></i></span>
                </li>
            @endif


        </ul>
    </nav>
@endif
