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

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

{% block content %}
{% call detail_page_header("(card?.customer_name || '" + _('loyalty.admin.merchant_card_detail.title') + "')", '/admin/loyalty/merchants/' ~ merchant_id ~ '/cards', subtitle_show='card') %}
    <span x-text="card?.card_number || ''"></span>
{% endcall %}

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

{% set card_detail_api_prefix = '/admin/loyalty/merchants/' + merchant_id|string %}
{% set card_detail_back_url = '/admin/loyalty/merchants/' + merchant_id|string + '/cards' %}
{% include 'loyalty/shared/card-detail-view.html' %}
{% endblock %}

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