@props(['currencies' => collect()]) @php $list = collect($currencies); $primary = $list->firstWhere('is_primary', true) ?: $list->firstWhere('rate_to_primary', 1) ?: $list->first(); $ordered = collect(); if ($primary) { $ordered->push($primary); $ordered = $ordered->concat( $list->reject(fn($c) => (strtoupper($c->code ?? '') === strtoupper($primary->code ?? ''))) ->sortBy(fn($c) => strtoupper($c->code ?? '')) ); } // Tamaño y estilo compacto para códigos/tasas $curSmall = 'text-[10px] uppercase font-semibold tracking-wide'; // Color por código $curClass = function($code) { $c = strtoupper(trim((string)$code)); return match ($c) { 'USD' => 'text-emerald-700', 'CUP' => 'text-sky-700', default => 'text-slate-700', }; }; // Tasa sin separadores/decimales (crudo) $fmtRateRaw = fn($r) => (string) (int) round((float)($r ?? 0)); @endphp @if($ordered->isNotEmpty())