{% set switcherData = aa_admin_locale_switcher() %}
{% if switcherData.locales|default([])|length %}
  <div class="locale-switcher">
    <a class="dropdown-toggle"
       href="#"
       id="userDropdown"
       role="button"
       data-bs-toggle="dropdown"
       aria-haspopup="true"
       aria-expanded="false"
    >
      <img class="locale-img"
           src="{{ asset('/bundles/autoadmin/back/images/locale/' ~ switcherData.current|lower ~ '.png')|webp() }}"
           alt="{{ switcherData.current|upper }}"
           loading="lazy"
      >
      <span class="text-gray-600">{{ app.request.get('_admin_locale')|upper }}</span>
      <span class="d-inline text-gray-600 small"><i class="fa fa-caret-circle-down"></i></span>
    </a>

    <div class="dropdown-menu dropdown-menu-right shadow" aria-labelledby="userDropdown">
      {% for l in switcherData.locales %}
      <a class="dropdown-item" href="{{ path('aa_admin_locale_switcher_switch', {newLocale: l}|merge(app.request.query)) }}">
        <img class="locale-img"
             src="{{ asset('/bundles/autoadmin/back/images/locale/' ~ l|lower ~ '.png')|webp() }}"
             alt="{{ l|upper }}"
             loading="lazy"
        >
        <span class="text-gray-600 mr-2">{{ l|upper }}</span>
      </a>
      {% endfor %}
    </div>
  </div>
{% endif %}