{# app/modules/loyalty/templates/loyalty/merchant/transactions.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.transactions.title') }}{% endblock %}

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

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

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

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

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

{% set transactions_api_prefix = '/merchants/loyalty' %}
{% set show_store_filter = true %}
{% include 'loyalty/shared/transactions-list.html' %}

{% endblock %}

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