<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_maintain_currencies_modal %}
<sw-modal
    class="sw-maintain-currencies-modal"
    :title="$tc('sw-maintain-currencies-modal.title')"
    @modal-close="onCancel"
>

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_maintain_currencies_modal_grid %}
    <sw-data-grid
        :data-source="currencyCollection"
        :columns="maintainCurrencyColumns"
        :show-selection="false"
        :compact-mode="false"
        :show-actions="false"
    >

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_maintain_currencies_modal_grid_column_name %}
        <template
            #column-name="{ item }"
        >

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_maintain_currencies_modal_grid_column_name_inherit_field %}
            <sw-inheritance-switch
                v-if="!item.isSystemDefault"
                class="sw-price-form__inherited-icon"
                :is-inherited="isCurrencyInherited(item)"
                @inheritance-restore="onInheritanceRestore(item.id)"
                @inheritance-remove="onInheritanceRemove(item)"
            />
            {% endblock %}

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_maintain_currencies_modal_grid_column_name_item_name %}
            <p>{{ item.translated.name || item.name }}</p>
            {% endblock %}
        </template>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_maintain_currencies_modal_grid_column_price %}
        <template #column-label-price>
            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_maintain_currencies_modal_grid_column_price_field_label %}
            <div class="sw-maintain-currencies-modal__price-label-wrapper">
                <div class="sw-maintain-currencies-modal__price-label">
                    {{ $tc('sw-maintain-currencies-modal.columnPrice') }}
                </div>
                <div
                    v-if="!hideListPrices"
                    class="sw-maintain-currencies-modal__list-price-label"
                >
                    {{ $tc('sw-maintain-currencies-modal.columnListPriceHeader') }}
                </div>
                <div
                    v-if="!hideRegulationPrices"
                    class="sw-maintain-currencies-modal__reference-price-label"
                >
                    {{ $tc('sw-maintain-currencies-modal.columnReferencePriceHeader') }}
                </div>
            </div>
            {% endblock %}
        </template>

        <template
            #column-price="{ item }"
        >
            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_maintain_currencies_modal_grid_column_price_field %}
            <sw-list-price-field
                :price="prices"
                :default-price="defaultPrice"
                :tax-rate="taxRate"
                :label="false"
                :disable-suffix="true"
                :hide-list-prices="hideListPrices"
                :hide-regulation-prices="hideRegulationPrices"
                hide-purchase-prices
                :disabled="disabled"
                enable-inheritance
                :currency="item"
            />
            {% endblock %}
        </template>
        {% endblock %}
    </sw-data-grid>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_maintain_currencies_modal_footer %}
    <template #modal-footer>

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_maintain_currencies_modal_footer_button_cancel %}
        <sw-button
            size="small"
            @click="onCancel"
        >
            {{ $tc('global.default.cancel') }}
        </sw-button>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_maintain_currencies_modal_footer_button_apply %}
        <sw-button
            variant="primary"
            size="small"
            @click="onApply"
        >
            {{ $tc('global.default.apply') }}
        </sw-button>
        {% endblock %}
    </template>
    {% endblock %}
</sw-modal>
{% endblock %}
