@php
  $asporti = $asporti ?? collect();
  $asportiConsegnati = $asportiConsegnati ?? collect();
  $asportiTimeline = $asportiTimeline ?? collect();
@endphp

<div class="asporto-pick-layout" id="asportoBoard" data-asporto-station="ritiro">
  @include('asporto._partials.h_timeline', [
    'asportiTimeline' => $asportiTimeline,
    'timelineTitle' => 'Timeline consegne',
    'timelineEmpty' => 'Nessuna consegna in elenco',
    'timelineAccent' => 'time',
  ])

  <div class="asporto-prep-station asporto-pick-station">
    <aside class="asporto-prep-queue">
      <div class="asporto-prep-queue__head">
        <div class="asporto-lane-brand">
          <i class="bx bx-package" aria-hidden="true"></i>
          <span class="asporto-prep-queue__title">Da ritirare</span>
        </div>
        <span class="asporto-lane-count asporto-lane-count--pick" id="badge-pick">{{ $asporti->count() }}</span>
      </div>

      <div class="asporto-prep-queue__body" id="lane-pick">
        @forelse($asporti as $asporto)
          @include('asporto._partials.card_ritiro', ['asporto' => $asporto])
        @empty
          <div class="text-muted text-center py-5" data-pick-empty>
            Nessun ordine in ritiro
          </div>
        @endforelse
      </div>
    </aside>

    <section class="asporto-prep-detail">
      <div class="asporto-prep-detail__head">
        <div class="asporto-lane-brand">
          <i class="bx bx-check-circle" aria-hidden="true"></i>
          <span class="asporto-prep-detail__title">Consegna</span>
        </div>
      </div>

      <div class="asporto-prep-placeholder" data-pick-placeholder @if($asporti->isNotEmpty()) hidden @endif>
        Seleziona un ordine dalla coda
      </div>

      @foreach($asporti as $asporto)
        @include('asporto._partials.modal.ritiro_ordine', ['asporto' => $asporto])
      @endforeach
    </section>

    <aside class="asporto-done-lane">
      <div class="asporto-done-lane__head">
        <div class="asporto-lane-brand">
          <i class="bx bx-check-double" aria-hidden="true"></i>
          <span class="asporto-done-lane__title">Consegnati</span>
        </div>
        <span class="asporto-lane-count asporto-lane-count--done" id="badge-done">{{ $asportiConsegnati->count() }}</span>
      </div>
      <div class="asporto-done-lane__body" id="lane-done">
        @forelse($asportiConsegnati as $asporto)
          @include('asporto._partials.card_consegnato', ['asporto' => $asporto])
        @empty
          <div class="text-muted small text-center py-3" data-done-empty>Nessuna consegna</div>
        @endforelse
      </div>
    </aside>
  </div>
</div>
