{# app/modules/loyalty/templates/loyalty/admin/merchant-devices.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.terminal_devices.title') }}{% endblock %}
{% block i18n_modules %}['loyalty']{% endblock %}
{% block alpine_data %}adminMerchantDevices(){% endblock %}

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

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

{% set devices_api_prefix = '/admin/loyalty/merchants/' + merchant_id|string %}
{% set show_store_filter = true %}
{% set show_crud = true %}
{% include 'loyalty/shared/devices-list.html' %}
{% endblock %}

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