@props([ 'title' => '', 'value' => '', 'subtitle' => '', 'icon' => '', 'color' => 'primary', 'trend' => null, 'trendValue' => null, 'trendLabel' => null, 'size' => 'default', 'href' => null, 'click' => null, ]) @php $bgColors = [ 'primary' => 'bg-primary', 'success' => 'bg-success', 'info' => 'bg-info', 'warning' => 'bg-warning', 'danger' => 'bg-danger', 'light' => 'bg-light', 'dark' => 'bg-dark', ]; $isLight = $color === 'light'; $bgClass = $bgColors[$color] ?? $bgColors['primary']; $sizeClasses = [ 'sm' => 'p-3', 'default' => 'p-4', 'lg' => 'p-5' ]; $paddingClass = $sizeClasses[$size] ?? $sizeClasses['default']; $isInteractive = $href || $click; @endphp
merge([ 'class' => "lead-stat-widget card border-0 rounded-4 shadow-sm overflow-hidden {$paddingClass} {$bgClass}" . ($isInteractive ? ' cursor-pointer' : ''), ]) }} @if($click) x-on:click="{{ $click }}" @endif >
@if($title)
{{ $title }}
@endif @if($value !== '')
{{ $value }}
@endif @if($subtitle)
{{ $subtitle }}
@endif @if($trend && $trendValue)
{{ $trendValue }} @if($trendLabel) {{ $trendLabel }} @endif
@endif
@if($icon)
@endif
{{ $slot }}