@props([ 'basePrice' => 0, 'margin' => 0, 'finalPrice' => 0, 'showMargin' => true, 'compact' => false ]) @php $formatPrice = function($price) { return 'Rp ' . number_format($price, 0, ',', '.'); }; @endphp @if($compact)
{{ $formatPrice($basePrice) }} @if($showMargin && $margin > 0) {{ $formatPrice($margin) }} @endif {{ $formatPrice($finalPrice) }}
@else
Harga Dasar {{ $formatPrice($basePrice) }}
@if($showMargin)
Margin + {{ $formatPrice($margin) }}
@endif
Total Harga {{ $formatPrice($finalPrice) }}
@endif