<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
{% block sw_sales_channel_menu %}
<div class="sw-sales-channel-menu">
    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_menu_modal %}
    <sw-sales-channel-modal
        v-if="showModal"
        @modal-close="showModal=false"
    />
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_menu_headline %}
    <div class="sw-admin-menu__headline">
        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_menu_headline_text %}
        <div class="collapsible-text sw-admin-menu__headline_text">
            <router-link
                :to="{ name: 'sw.sales.channel.list' }"
            >{{ $tc('sw-sales-channel.general.titleMenuItems') }}</router-link>
        </div>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_menu_headline_context_button %}
        <sw-context-button
            class="sw-admin-menu__headline-context-menu"
            icon="solid-ellipsis-h"
        >
            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_sales_channel_menu_headline_context_button_item %}
            <sw-context-menu-item
                class="sw-admin-menu__headline-context-menu-manage-sales-channels"
                :router-link="{ name: 'sw.sales.channel.list' }"
            >
                {{ $tc('sw-sales-channel.general.manageSalesChannels') }}
            </sw-context-menu-item>
            {% endblock %}
        </sw-context-button>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_menu_headline_action %}
        <button
            v-if="canCreateSalesChannels"
            :aria-label="$tc('sw-sales-channel.general.addSalesChannel')"
            class="sw-admin-menu__headline-action"
            @click="openSalesChannelModal"
        >
            <sw-icon
                class="sw-admin-menu__headline-icon"
                name="regular-plus-circle-s"
                small
            />
        </button>
        {% endblock %}
    </div>
    {% endblock %}

    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
    {% block sw_sales_channel_menu_navigation %}
    <nav class="sw-admin-menu__navigation">

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_menu_navigation_main_list %}
        <ul class="sw-admin-menu__navigation-list">

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_sales_channel_menu_navigation_main_items %}
            <sw-admin-menu-item
                v-for="(entry, index) in buildMenuTree"
                :key="entry.id || index"
                class="sw-admin-menu__sales-channel-item"
                :entry="entry"
                icon-size="16px"
                :class="['sw-admin-menu__sales-channel-item--' + index]"
            >
                <template #additional-text>
                    <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
                    {% block sw_sales_channel_menu_navigation_item_additional_text %}
                    <button
                        v-if="entry.domainLink && entry.active"
                        class="sw-sales-channel-menu-domain-link"
                        :title="$tc('sw-sales-channel.general.tooltipOpenStorefront')"
                        @click.prevent="openStorefrontLink(entry.domainLink)"
                    >
                        <sw-icon
                            class="sw-sales-channel-menu-domain-link__icon"
                            name="regular-eye-s"
                            size="16px"
                        />
                    </button>
                    {% endblock %}
                </template>
            </sw-admin-menu-item>
            {% endblock %}

            <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
            {% block sw_sales_channel_menu_navigation_more_items %}
            <sw-admin-menu-item
                v-if="moreSalesChannelAvailable"
                :entry="moreItemsEntry"
                class="sw-admin-menu__sales-channel-more-items"
                icon-size="16px"
            />
            {% endblock %}
        </ul>
        {% endblock %}

        <!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
        {% block sw_sales_channel_menu_context_button_collapsed %}
        <sw-context-button
            class="sw-sales-channel-menu__collapsed-context-menu"
            icon="regular-ellipsis-v"
            aria-label="sw-sales-channel.general.manageSalesChannels"
        >
            <sw-context-menu-item
                class="sw-admin-menu__headline-context-menu-manage-sales-channels"
                :router-link="{ name: 'sw.sales.channel.list' }"
            >
                {{ $tc('sw-sales-channel.general.manageSalesChannels') }}
            </sw-context-menu-item>
        </sw-context-button>
        {% endblock %}

    </nav>
    {% endblock %}
</div>
{% endblock %}
