{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
{# @var action \EasyCorp\Bundle\EasyAdminBundle\Dto\ActionDto #}
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}

{% if 'a' == action.htmlElement %}
    {% for _locale in app_locales %}
        <a class="{{ isIncludedInDropdown|default(false) ? 'dropdown-item' }} {{ action.cssClass }}"
           href="{{ action.linkUrl }}&_locale={{ _locale }}"
        {% for name, value in action.htmlAttributes %}{{ name }}="{{ value|e('html_attr') }}" {% endfor %}>
        {%- if action.icon %}<i class="action-icon {{ action.icon }}"></i> {% endif -%}
        {%- if action.label is not empty -%}{{ action.label }} {%- endif -%}
        {{ _locale }}
        </a>
    {% endfor %}
{% elseif 'button' == action.htmlElement %}
    <button class="{{ action.cssClass }}" {% for name, value in action.htmlAttributes %}{{ name }}="{{ value|e('html_attr') }}" {% endfor %}>
    <span class="btn-label">
            {%- if action.icon %}<i class="action-icon {{ action.icon }}"></i> {% endif -%}
        {%- if action.label is not empty -%}{{ action.label }}{%- endif -%}
        </span>
    </button>
{% endif %}
