{# app/modules/loyalty/templates/loyalty/merchant/cards.html #}
{% extends "merchant/base.html" %}
{% from 'shared/macros/headers.html' import page_header_flex, refresh_button %}
{% from 'shared/macros/alerts.html' import loading_state, error_state %}

{% block title %}{{ _('loyalty.merchant.cards.title') }}{% endblock %}

{% block i18n_modules %}['loyalty']{% endblock %}

{% block alpine_data %}merchantLoyaltyCards(){% endblock %}

{% block content %}
{% call page_header_flex(title=_('loyalty.merchant.cards.title'), subtitle=_('loyalty.merchant.cards.subtitle')) %}
    <div class="flex items-center gap-3">
        {{ refresh_button(loading_var='loading', onclick='loadCards()', variant='secondary') }}
    </div>
{% endcall %}

{{ loading_state(_('loyalty.merchant.cards.loading')) }}

{{ error_state(_('loyalty.merchant.cards.error_loading')) }}

{% set cards_api_prefix = '/merchants/loyalty' %}
{% set cards_base_url = '/merchants/loyalty/cards' %}
{% set show_store_filter = true %}
{% set show_enroll_button = false %}
{% include 'loyalty/shared/cards-list.html' %}

{% endblock %}

{% block extra_scripts %}
<script defer src="{{ url_for('loyalty_static', path='shared/js/loyalty-cards-list.js') }}"></script>
<script defer src="{{ url_for('loyalty_static', path='merchant/js/loyalty-cards.js') }}"></script>
{% endblock %}
