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

<div class="asporto-prep-layout" id="asportoBoard" data-asporto-station="preparazione">
  @include('asporto._partials.h_timeline', [
    'asportiTimeline' => $asportiTimeline,
    'timelineTitle' => 'Timeline assemblaggio',
    'timelineEmpty' => 'Nessun ordine da assemblare',
    'timelineAccent' => 'prep',
  ])

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

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

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

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

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