@props([ 'amount', 'currency' => null, 'type' => null, // 'income', 'expense', or null 'showSign' => false, ]) @php $currencySymbol = $currency?->symbol ?? 'Rp'; $formattedAmount = number_format(abs($amount), 2, ',', '.'); $colorClass = match($type) { 'income' => 'text-green-600 dark:text-green-400', 'expense' => 'text-red-600 dark:text-red-400', default => 'text-gray-900 dark:text-white', }; $sign = ''; if ($showSign) { $sign = $type === 'income' ? '+' : ($type === 'expense' ? '-' : ''); } @endphp merge(['class' => $colorClass]) }}> {{ $sign }}{{ $currencySymbol }} {{ $formattedAmount }}