<nav
  {{ attributes.defaults({class: 'fixed h-screen w-0 shadow-sm transition-all duration-500 ease-in-out md:w-64 border-gray-200 bg-white border-r dark:border-gray-800 dark:bg-gray-900'}) }}
  id="sidebar-menu"
  x-bind:aria-expanded="open"
  :class="{ 'w-64 md:w-0': open, 'w-0 md:w-64': !(open) }">
  <div class="mt-20 h-full overflow-y-auto">
    <!-- Sidebar menu -->
    {{
      knp_menu_render('sidebarAdminMenu', {
      'template' : '@extends/SerenityAdmin/sidebar_knp_menu.html.twig',
      })
    }}
    {% if config('admin',true) and config('admin',true).cardSidebar and config('admin',true).cardSidebar.enabled %}
      <!-- Banner -->
      <div class="box-banner px-4">
        <div class="bg-opacity-50 my-8 rounded-lg bg-gray-300 p-4 text-center dark:bg-gray-700">
          {% if config('admin',true).cardSidebar.title %}
            <h4
              class="mb-2 inline-block font-bold">
              {{ config('admin',true).cardSidebar.title|raw }}
            </h4>
          {% endif %}
          {% if config('admin',true).cardSidebar.text %}
            <div class="text-sm">
              {{ config('admin',true).cardSidebar.text|raw }}
            </div>
          {% endif %}
          {% if config('admin',true).cardSidebar.buttonText and config('admin',true).cardSidebar.buttonUrl %}
            <div class="grid">
              <a
                href="{{ config('admin',true).cardSidebar.buttonUrl }}"
                class="nline-block bg-primary hover:bg-primary-hover mt-3 rounded px-4 py-2 text-center leading-5 text-gray-100 hover:border-pink-600 hover:text-white hover:ring-0 focus:border-pink-600 focus:bg-pink-600 focus:ring-0 focus:outline-none"
                target="_blank">
                {{ config('admin',true).cardSidebar.buttonText }}
              </a>
            </div>
          {% endif %}
        </div>
      </div>
      <!-- end banner -->
    {% endif %}
    {% if is_granted('ROLE_MODERATOR') %}
      <div
        x-show="!(open)"
        x-transition
        class="absolute bottom-10 w-full border-t border-gray-200 bg-white px-4 py-3 dark:border-gray-800 dark:bg-gray-900">
        <a
          href="{{ path('core_settings_general') }}"
          class="flex gap-1 text-center text-sm text-gray-600 dark:text-gray-300"
          data-turbo-frame="settings">
          <div class="icon-settings"></div>
          {{ 'settings'|trans([],'serenity_admin_messages') }}
        </a>
      </div>
    {% endif %}
  </div>
</nav>
