{{-- Reusable Insight Card Component Props: - icon: string — icon name for the component - title: string — bold heading text - description: string — supporting description (text-muted) - actionUrl: string — CTA href - actionLabel: string — CTA button text - priority: string — urgent|attention|suggestion|positive - dismissable: bool — whether dismiss (X) button is shown (default true) - insightId: string — unique ID for dismiss tracking (optional, used by Livewire parent) --}} @props([ 'icon' => 'sparkles', 'title' => '', 'description' => '', 'actionUrl' => '#', 'actionLabel' => 'Take Action', 'priority' => 'suggestion', 'dismissable' => true, 'insightId' => '', ]) @php $borderColor = match ($priority) { 'urgent' => 'border-l-red-500 dark:border-l-red-400', 'attention' => 'border-l-amber-500 dark:border-l-amber-400', 'suggestion'=> 'border-l-blue-500 dark:border-l-blue-400', 'positive' => 'border-l-green-500 dark:border-l-green-400', default => 'border-l-blue-500 dark:border-l-blue-400', }; $iconBg = match ($priority) { 'urgent' => 'bg-danger/10 dark:bg-red-900/30', 'attention' => 'bg-warning/10 dark:bg-amber-900/30', 'suggestion'=> 'bg-info/10 dark:bg-blue-900/30', 'positive' => 'bg-success/10 dark:bg-green-900/30', default => 'bg-info/10 dark:bg-blue-900/30', }; $iconColor = match ($priority) { 'urgent' => 'text-red-600 dark:text-red-400', 'attention' => 'text-amber-600 dark:text-amber-400', 'suggestion'=> 'text-blue-600 dark:text-blue-400', 'positive' => 'text-green-600 dark:text-green-400', default => 'text-blue-600 dark:text-blue-400', }; @endphp
merge([ 'class' => "relative bg-surface-2 rounded-xl border border-border border-l-4 {$borderColor} p-4 shadow-sm hover:shadow-md transition-all duration-200 group" ]) }}> {{-- Dismiss button --}} @if($dismissable && $insightId) @endif
{{-- Icon --}}
{{-- Content --}}

{{ $title }}

{{ $description }}

{{-- CTA Button --}} {{ $actionLabel }}