{# OOB swap for day confirmed entries nav when entries are edited #}
{% import 'macros/links.html' as links %}

{# Confirmed Entries - vertical on mobile, horizontal with arrows on desktop #}
{% if confirmed_entries %}
  <div class="flex flex-col sm:flex-row sm:items-center gap-2 border-r border-stone-200 mr-2 sm:max-w-2xl"
       id="day-entries-nav-wrapper"
       hx-swap-oob="true">
    {% from 'macros/scrolling_menu.html' import scrolling_menu with context %}
    {% call(entry) scrolling_menu('day-entries-container', confirmed_entries) %}
      <a
        href="{{ url_for('calendars.calendar.day.calendar_entries.calendar_entry.get',
                         slug=post.slug,
                         calendar_slug=calendar.slug,
                         year=day_date.year,
                         month=day_date.month,
                         day=day_date.day,
                         entry_id=entry.id) }}"
        class="{{styles.nav_button}}"
      >
        <div class="flex-1 min-w-0">
          <div class="font-medium truncate">{{ entry.name }}</div>
          <div class="text-xs text-stone-600 truncate">
            {{ entry.start_at.strftime('%H:%M') }}
            {% if entry.end_at %} – {{ entry.end_at.strftime('%H:%M') }}{% endif %}
          </div>
        </div>
      </a>
    {% endcall %}
  </div>
{% else %}
  {# Empty placeholder to remove nav entries when none are confirmed #}
  <div id="day-entries-nav-wrapper" hx-swap-oob="true"></div>
{% endif %}
