{{-- Componente Card Statistica Componente riutilizzabile per visualizzare statistiche numeriche con icona Parametri: - title: Titolo della statistica - value: Valore numerico da visualizzare - icon: Classe CSS dell'icona (es: 'fas fa-building') - color: Colore del tema (primary, success, warning, danger, info) - subtitle: Sottotitolo opzionale - link: Link opzionale per rendere la card cliccabile --}} @props([ 'title' => 'Statistica', 'value' => '0', 'icon' => 'fas fa-chart-bar', 'color' => 'primary', 'subtitle' => null, 'link' => null ]) @php $colorClasses = [ 'primary' => 'text-blue-500 bg-blue-100', 'success' => 'text-green-500 bg-green-100', 'warning' => 'text-yellow-500 bg-yellow-100', 'danger' => 'text-red-500 bg-red-100', 'info' => 'text-indigo-500 bg-indigo-100', ]; $cardClass = $link ? 'cursor-pointer hover:shadow-lg transition-shadow' : ''; $iconColor = $colorClasses[$color] ?? $colorClasses['primary']; @endphp
{{ $title }}
{{ $value }}
@if($subtitle)
{{ $subtitle }}
@endif
@if($link)
@endif