<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_promotion_detail_discounts %}
<div class="sw-promotion-detail-discounts">
    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_promotion_detail_discounts_card_add %}
    <div
        class="promotion-detail-discounts__action_add"
        position-identifier="sw-promotion-detail-discounts"
    >
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_promotion_detail_discounts_actions_add %}
        <sw-button
            v-tooltip="{
                message: $tc('sw-privileges.tooltip.warning'),
                disabled: acl.can('promotion.editor'),
                showOnDisabledElements: true
            }"
            :is-loading="isLoading"
            variant="ghost"
            :disabled="(promotion && promotion.hasOrders) || !acl.can('promotion.editor')"
            @click="onAddDiscount"
        >
            {{ $tc('sw-promotion.detail.main.discounts.buttonAddDiscount') }}
        </sw-button>
        {% endblock %}
    </div>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_promotion_detail_discounts_items %}
    <ul class="sw-promotion-detail-discounts__discount-list">
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_promotion_detail_discounts_item_form %}
        <sw-promotion-discount-component
            v-for="discount in discounts"
            :key="discount.id"
            :promotion="promotion"
            :discount="discount"
            @discount-delete="deleteDiscount"
        />
        {% endblock %}
    </ul>
    {% endblock %}
</div>
{% endblock %}
