{# partials/pagination.html — reusable pagination component (Tailwind-first, no legacy classes) #} {% macro render_pagination(page, total_pages, total_items, per_page, next_cursor=None, has_next=false, pagination_mode="offset") %} {% if pagination_mode and "cursor" in pagination_mode %} {# Cursor-based pagination #}
{% if has_next or total_items > per_page %} {% if page is defined and page > 1 %} Showing cursor-based results (page {{ page }}) {% else %} Showing cursor-based results {% endif %} {% else %} Showing all {{ total_items | int }} results {% endif %}
{% if has_next %} {{ icon("chevron-right", size="16px") }} {% else %} {{ icon("chevron-right", size="16px") }} {% endif %}
{% else %} {# Offset-based pagination (default) #}
Showing {{ ((page - 1) * per_page + 1) | int }} to {{ (page * per_page) if page < total_pages else total_items | int }} of {{ total_items | int }} results
{% endif %} {% endmacro %}