@if($paginaIndex === 0)
@php $testoHeader = !empty($header ?? null) ? $header : null; @endphp
@endif
@foreach($pastiPagina as $pastoKey => $sezione)
{{ $sezione['label'] }}
@php
$varianti = $sezione['varianti'] ?? [];
$chunks = array_chunk($varianti, 2);
$counter = 1;
@endphp
@foreach($chunks as $riga)
@foreach($riga as $variante)
{{ $sezione['label'] }} {{ $counter }}
@forelse($variante['alimenti'] as $alimento)
{{ $alimento['nome'] ?? 'Alimento' }} ({{ (int) ($alimento['quantita_g'] ?? 0) }} g)
@if(!empty($alimento['sostituti'] ?? []))
Sostituti:
@foreach($alimento['sostituti'] as $sost)
{{ $sost['nome'] ?? 'Alimento' }} ({{ (int) ($sost['quantita_g'] ?? 0) }} g)@if(!$loop->last), @endif
@endforeach
@endif
@empty
Nessun alimento inserito.
@endforelse
@php $counter++; @endphp
@endforeach
@endforeach
@endforeach