{% block component_load_more_nav %}
{% set currentPage = app.request.query.get('p')|round(0, 'ceil') %}
{% set totalEntities = total ? total : entities.total %}
{% set totalPages = (totalEntities / limit)|round(0, 'ceil') %}
{% set paginationSuffix = '' %}
{# @deprecated tag:v6.5.0 - pagination template will append `paginationSuffix` for input and label ids to avoid duplicate ids. #}
{% if feature('v6.5.0.0') and paginationLocation %}
{% set paginationSuffix = '-' ~ paginationLocation %}
{% endif %}
{% if totalPages > 1 %}
<nav aria-label="pagination" class="pagination-nav load-more-nav">
{% block component_load_more %}
<ul class="pagination">
{% if currentPage < totalPages %}
{% set page = currentPage + 1 %}
{% else %}
{% set page = currentPage - 1 %}
{% endif %}
{% block component_load_more_btn %}
<li class="page-item{% if isActive %} active{% endif %}">
{% block component_load_more_item_input %}
<input type="radio"
name="p"
id="p{{ page }}{{ paginationSuffix }}"
value="{{ page }}"
class="d-none"
title="load-more"
{% if isActive %}checked="checked"{% endif %}>
{% endblock %}
{% block component_load_more_item_label %}
<label class="page-link"
for="p{{ page }}{{ paginationSuffix }}">
{% block component_load_more_item_link %}
{% block component_load_more_item_text %}
{% if currentPage < totalPages %}
{{ 'mrpixShoppingCity.listing.loadMoreBtn'|trans|sw_sanitize }}
{% else %}
{{ 'mrpixShoppingCity.listing.showLessBtn'|trans|sw_sanitize }}
{% endif %}
{% endblock %}
{% endblock %}
</label>
{% endblock %}
</li>
{% endblock %}
</ul>
{% endblock %}
</nav>
{% endif %}
{% endblock %}