@php /** @var \Illuminate\Support\Collection $items */ /** @var string $primaryCode */ /** @var bool $showBoth */ /** @var string $variant */ $others = $items->filter(fn($i) => !$i['is_primary']); @endphp @if($items->isNotEmpty())
@if($variant === 'stacked') {{-- ====== VARIANTE APILADA (ideal sidebar) ====== --}}
{{ $primaryCode }} base
@foreach($others as $it)
{{ $it['code'] }} {{-- Línea 1: 1 BASE = N OTRA --}} 1 {{ $primaryCode }} = {{ number_format($it['eq_per_primary'], $decimals) }} {{ $it['code'] }}
@if($showBoth) {{-- Línea 2: 1 OTRA = rate BASE --}}
1 {{ $it['code'] }} = {{ number_format($it['rate_to_primary'], $decimals) }} {{ $primaryCode }}
@endif
@endforeach
@else {{-- ====== VARIANTE SCROLL (chips en fila) ====== --}}
{{ $primaryCode }} base @foreach($others as $it) {{ $it['code'] }} 1 {{ $primaryCode }} = {{ number_format($it['eq_per_primary'], $decimals) }} {{ $it['code'] }} @if($showBoth) 1 {{ $it['code'] }} = {{ number_format($it['rate_to_primary'], $decimals) }} {{ $primaryCode }} @endif @endforeach
@endif
@endif