@php use Filament\Infolists\Components\IconEntry\IconEntrySize; $stateValue = $getState(); if ($stateValue instanceof Closure) { $stateValue = $stateValue(); } $total = 100; $progress = ($stateValue / $total) * 100; $displayProgress = $progress == 100 ? number_format($progress, 0) : number_format($progress, 2); $color = $getColor($state) ?? 'gray'; $colorMap = [ 'primary' => 'rgba(13, 110, 253, 1)', 'secondary' => 'rgba(108, 117, 125, 1)', 'success' => 'rgba(25, 135, 84, 1)', 'danger' => 'rgba(220, 53, 69, 1)', 'warning' => 'rgba(255, 193, 7, 1)', 'info' => 'rgba(13, 202, 240, 1)', 'light' => 'rgba(248, 249, 250, 1)', 'dark' => 'rgba(33, 37, 41, 1)', ]; $bgColor = $colorMap[$color] ?? $color; @endphp
merge($getExtraAttributes(), escape: false) ->class([ 'fi-in-progress-bar flex flex-wrap gap-1.5', ]) }} >
$displayProgress != 100, 'text-white' => $displayProgress == 100 ]) > {{ $displayProgress }}%