<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_settings_rule_add_assignment_modal %}
<sw-modal
    class="sw-settings-rule-add-assignment-modal"
    :title="$tc(entityContext.label)"
    :variant="modalSize"
    @modal-close="onCloseAddModal"
>

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_settings_rule_add_assignment_modal_category_tree %}
    <sw-settings-rule-category-tree
        v-if="entityContext.entityName === 'category'"
        :rule="rule"
        :association="entityContext.addContext.association"
        :categories-collection="entities"
        :hide-headline="true"
        :hide-search="true"
        placeholder="Add categories"
        @on-selection="onSelect"
    />
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_settings_rule_add_assignment_modal_listing %}
    <sw-settings-rule-add-assignment-listing
        v-else
        class="sw-settings-rule-detail-assignments__entity-listing"
        :entity-context="entityContext"
        :rule-id="rule.id"
        @select-item="onSelect"
    />
    {% endblock %}

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

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_settings_rule_add_assignment_modal_cancel %}
        <sw-button
            class="sw-settings-rule-add-assignment-modal__cancel-button"
            size="small"
            @click="onCloseAddModal"
        >
            {{ $tc('global.default.cancel') }}
        </sw-button>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_settings_rule_add_assignment_modal_confirm %}
        <sw-button
            class="sw-settings-rule-add-assignment-modal__confirm-button"
            size="small"
            variant="primary"
            @click="onAdd"
        >
            {{ $tc('global.default.add') }}
        </sw-button>
        {% endblock %}
    </template>
    {% endblock %}
</sw-modal>
{% endblock %}
