{% extends "@FerienpassAdmin/layout/base.html.twig" %}
{% trans_default_domain 'admin' %}
{% set title = 'offers.title' %}

{% block main %}

  <div class="mb-6">
    <div class="flex items-center gap-4 flex-wrap">
      <twig:Admin:EditionSwitcher
              :editions="editions|default([])"
              :selected="selectedEditions|default([])"
              baseLabel="Angebote"
              unscopedRoute="admin_offers_calendar"
              scopedRoute="admin_offers_calendar_in_edition" />

      <div class="h-6 w-px bg-gray-300 dark:bg-gray-700"></div>
      <nav class="flex items-center space-x-4 overflow-x-auto py-1">
        <a href="{{ edition ? path('admin_offers_index', { edition: edition.alias }) : path('admin_offers_index') }}"
           class="text-sm font-medium whitespace-nowrap {{ (app.request.get('_route')|split('.')|first) == 'admin_offers_index' ? 'text-primary-600 dark:text-primary-400' : 'text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300' }}">
          Liste
        </a>
        <a href="{{ edition ? path('admin_offers_calendar_in_edition', { edition: edition.alias }) : path('admin_offers_calendar') }}"
           class="text-sm font-medium whitespace-nowrap {{ (app.request.get('_route')|split('.')|first) in ['admin_offers_calendar', 'admin_offers_calendar_in_edition'] ? 'text-primary-600 dark:text-primary-400' : 'text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300' }}">
          Kalender
        </a>
      </nav>
    </div>

  </div>

  <twig:Admin:OfferCalendar
          edition="{{ edition }}"
          :editionAliases="(selectedEditions|default([]))|length > 1 ? (selectedEditions|map(e => e.alias)) : []" />

{% endblock %}
