{% set switcherData = aa_admin_locale_switcher() %}
{% if switcherData.locales|default([])|length %}
  <nav class="navbar navbar-expand-lg locale-switcher">
    <div class="container-fluid">
      <div class="collapse navbar-collapse" id="navbarNavDarkDropdown">
        <ul class="navbar-nav">
          <li class="nav-item dropdown">
            <a class="dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" href="#">
              <span class="mr-2 d-inline text-gray-600 small"><i class="fa fa-chevron-down"></i></span>
              <span class="text-gray-600 mr-2">{{ app.request.get('_admin_locale')|upper }}</span>
              <img class="img-profile rounded-circle"
                   src="{{ asset('/bundles/autoadmin/front/images/locale/' ~ switcherData.current|lower ~ '.png')|webp() }}"
                   alt="{{ switcherData.current|upper }}"
                   style="width: 25px;height: 25px;"
              >
            </a>
            <div class="dropdown-menu">
              {% for locale in switcherData.locales %}
                <a class="dropdown-item"
                   href="{{ app.request.scheme ~ '://' ~ app.request.host }}{{ aa_content_path_safe(content, {'_locale': locale.code}, 'chain', {'locale': locale.code}) }}">
                  <span class="text-gray-600 mr-2">{{ locale|upper }}</span>
                  <img class="img-profile rounded-circle"
                       src="{{ asset('/bundles/autoadmin/front/images/locale/' ~ locale|lower ~ '.png')|webp() }}"
                       alt="locale image"
                       style="width: 25px;height: 25px;"
                  >
                </a>
              {% endfor %}
            </div>
          </li>
        </ul>
      </div>
    </div>
  </nav>
{% endif %}

