{% if pagination and pagination.pages is defined and pagination.pages|length > 1 %}
<nav aria-label="{{ __('Page navigation') }}" class="my-5">
    <ul class="pagination justify-content-center">
        <li class="page-item{{ pagination.prev_url is null ? ' disabled' : '' }}">
            <a class="page-link" href="{{ pagination.prev_url ?? '#' }}"
               {% if pagination.prev_url is null %}tabindex="-1" aria-disabled="true"{% endif %}>
                {{ pagination.prev_text }}
            </a>
        </li>
        {% for page in pagination.pages %}
            <li class="page-item{{ page.is_current ? ' active' : '' }}">
                <a class="page-link" href="{{ page.url }}"
                   {% if page.is_current %}aria-current="page"{% endif %}>
                    {{ page.number }}
                </a>
            </li>
        {% endfor %}
        <li class="page-item{{ pagination.next_url is null ? ' disabled' : '' }}">
            <a class="page-link" href="{{ pagination.next_url ?? '#' }}"
               {% if pagination.next_url is null %}tabindex="-1" aria-disabled="true"{% endif %}>
                {{ pagination.next_text }}
            </a>
        </li>
    </ul>
</nav>
{% endif %}
