@props([
'title' => null,
'icon' => null,
'subtitle' => null,
'value' => null,
'trend' => null,
'trendDirection' => null,
'hover' => false,
'compact' => false,
'variant' => 'default',
])
merge([
'class' => 'fluent-card ' .
($variant === 'kpi' ? 'fluent-card--kpi ' : '') .
($hover ? 'fluent-card--hover ' : '') .
($compact ? 'fluent-card--compact ' : '')
]) }}
>
{{-- =========================
KPI MODE
========================= --}}
@if($variant === 'kpi')
@if($title)
{{ $title }}
@endif
@if($value !== null)
{{ is_numeric($value) ? number_format($value) : $value }}
@endif
@if($subtitle)
{{ $subtitle }}
@endif
@if($trend)
@if($trendDirection === 'up')
↑
@elseif($trendDirection === 'down')
↓
@else
→
@endif
{{ $trend }}
@endif
@if($icon)
@endif
@else
{{-- =========================
DEFAULT MODE (EXISTING)
========================= --}}
@if($title || $subtitle || $icon)
@endif
{{ $slot }}
@isset($footer)
@endisset
@endif