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

{% block title %}{{ _('loyalty.admin.merchant_cards.title') }}{% endblock %}
{% block i18n_modules %}['loyalty']{% endblock %}
{% block alpine_data %}adminMerchantCards(){% endblock %}

{% block content %}
{% call detail_page_header("'" + _('loyalty.admin.merchant_cards.title') + ": " + (merchant_name or '') + "'", '/admin/loyalty/merchants/' ~ merchant_id, subtitle_show='program') %}
    {{ _('loyalty.admin.merchant_cards.subtitle') }}
{% endcall %}

{{ loading_state(_('loyalty.admin.merchant_cards.loading')) }}
{{ error_state(_('loyalty.admin.merchant_cards.error_loading')) }}

{% set cards_api_prefix = '/admin/loyalty/merchants/' + merchant_id|string %}
{% set cards_base_url = '/admin/loyalty/merchants/' + merchant_id|string + '/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='admin/js/loyalty-merchant-cards.js') }}"></script>
{% endblock %}
