@foreach($labelsPasti as $pastoKey => $pastoLabel)
@if(isset($pasti[$pastoKey]))
@php
$dati = $pasti[$pastoKey];
$ora = $dati['ora'] ?? '–';
$alimenti = $dati['alimenti'] ?? [];
$totali = $dati['totali_pasto'] ?? [];
@endphp
{{ $pastoLabel }}
({{ $ora }})
@if(!empty($alimenti))
@foreach($alimenti as $riga)
@php
$aid = (int)($riga['alimento_id'] ?? 0);
$nome = $nomiAlimenti[$aid] ?? 'Alimento #' . $aid;
$qty = $riga['quantita_g'] ?? 0;
@endphp
- {{ $nome }} — {{ number_format($qty, 0) }} g
@endforeach
Riepilogo: {{ round($totali['energia_kcal'] ?? 0) }} kcal —
P {{ number_format($totali['proteine_g'] ?? 0, 1) }} g —
C {{ number_format($totali['carboidrati_g'] ?? 0, 1) }} g —
L {{ number_format($totali['lipidi_g'] ?? 0, 1) }} g —
F {{ number_format($totali['fibre_g'] ?? 0, 1) }} g
@else
Nessun alimento.
@endif
@endif
@endforeach