@php /** * FuelPrice bileşeni: rakam baskın; birim/yakıt küçük; ortalamaya göre fark metinle (renge ek olarak). * $price (float|null), $fuel (etiket), $avg (float|null), $size ('xl'|'lg'|'md'), $best (bool), $crowd (bool), $meta (ek satır) */ use App\Support\SiteFormat; $size = $size ?? 'lg'; $best = $best ?? false; $crowd = $crowd ?? false; $diff = isset($avg) && $avg !== null && $price !== null ? round($price - $avg, 3) : null; $sizeClass = ['xl' => 'text-[56px] sm:text-[64px]', 'lg' => 'text-[34px]', 'md' => 'text-[22px]'][$size]; @endphp {{ SiteFormat::price($price) }} @if ($size !== 'md') {{ __('site.unit') }} @endif @if (isset($fuel) && $size !== 'md') {{ $fuel }} @endif @if ($diff !== null) @if (abs($diff) < 0.0005){{ __('site.price.at_avg') }}@elseif ($diff < 0){{ __('site.price.vs_avg_down', ['diff' => SiteFormat::price(abs($diff))]) }}@else{{ __('site.price.vs_avg_up', ['diff' => SiteFormat::price(abs($diff))]) }}@endif @endif @if (! empty($meta)) {{ $meta }} @endif