@if ($paginator->hasPages())
    <div class="database-pagination">

        {{-- Précédent --}}
        @if ($paginator->onFirstPage())
            <button class="btn" disabled>«</button>
        @else
            <button class="btn" wire:click="previousPage">«</button>
        @endif

        {{-- Pages --}}
        @foreach ($elements as $element)
            @if (is_string($element))
                <button class="btn" disabled>{{ $element }}</button>
            @endif

            @if (is_array($element))
                @foreach ($element as $page => $url)
                    <button
                        class="btn {{ $page == $paginator->currentPage() ? 'active' : '' }}"
                        wire:click="gotoPage({{ $page }})"
                    >{{ $page }}</button>
                @endforeach
            @endif
        @endforeach

        {{-- Suivant --}}
        @if ($paginator->hasMorePages())
            <button class="btn" wire:click="nextPage">»</button>
        @else
            <button class="btn" disabled>»</button>
        @endif

    </div>
@endif
