@props([ 'label', 'value', 'icon' => 'bi-graph-up', 'trend' => null, 'trendDirection' => 'neutral', 'variant' => 'primary', 'counter' => null, 'prefix' => '', 'suffix' => '', 'decimals' => 0, ]) @php $variantClass = match($variant) { 'success' => 'bv-stat-card--success', 'warning' => 'bv-stat-card--warning', 'danger' => 'bv-stat-card--danger', 'info' => 'bv-stat-card--info', 'accent' => 'bv-stat-card--accent', default => '', }; $trendClass = match($trendDirection) { 'up' => 'bv-stat-card__trend--up', 'down' => 'bv-stat-card__trend--down', default => 'bv-stat-card__trend--neutral', }; $trendIcon = match($trendDirection) { 'up' => 'bi-arrow-up-short', 'down' => 'bi-arrow-down-short', default => 'bi-dash', }; @endphp
merge(['class' => 'bv-stat-card ' . $variantClass]) }}>
@isset($action)
{{ $action }}
@endisset
@if(!is_null($counter))
{{ $prefix }}0{{ $suffix }}
@else
{{ $value }}
@endif
{{ $label }}
@if($trend)
{{ $trend }}
@endif