@php use App\Support\Ui\EnterpriseDetail\FactPresentation; $items = $items ?? []; $items = is_array($items) ? array_values(array_filter($items, 'is_array')) : []; $action = $action ?? null; $action = is_array($action) ? $action : null; $variant = is_string($variant ?? null) && trim($variant) !== '' ? trim($variant) : 'default'; $gridClasses = match ($variant) { 'header' => 'grid gap-3 sm:grid-cols-2 xl:grid-cols-4', 'summary' => 'grid gap-3 lg:grid-cols-2', 'supporting' => 'grid gap-3 sm:grid-cols-2', 'diagnostic' => 'grid gap-3 sm:grid-cols-2 xl:grid-cols-4', 'technical' => 'grid gap-3 sm:grid-cols-2 xl:grid-cols-3', default => 'grid gap-3 sm:grid-cols-2', }; $cardClasses = match ($variant) { 'summary' => 'rounded-2xl border border-gray-200 bg-white px-4 py-4 shadow-sm dark:border-gray-800 dark:bg-gray-900', default => 'rounded-xl border border-gray-200 bg-gray-50/70 px-4 py-3 dark:border-gray-800 dark:bg-gray-950/30', }; @endphp
@foreach ($items as $item) @php $displayValue = FactPresentation::value($item); $badge = is_array($item['badge'] ?? null) ? $item['badge'] : null; $tone = is_string($item['tone'] ?? null) ? $item['tone'] : null; $mono = (bool) ($item['mono'] ?? false); $toneValueClasses = match ($tone) { 'danger' => 'text-danger-600 dark:text-danger-400', 'success' => 'text-success-600 dark:text-success-400', 'warning' => 'text-warning-600 dark:text-warning-400', default => 'text-gray-900 dark:text-white', }; @endphp
{{ $item['label'] ?? 'Detail' }}
@if ($displayValue !== null) {{ $displayValue }} @endif @if ($badge !== null) {{ $badge['label'] ?? 'State' }} @endif
@if (filled($item['hint'] ?? null))
{{ $item['hint'] }}
@endif
@endforeach
@if ($action !== null && filled($action['url'] ?? null))
@if (($action['openInNewTab'] ?? false) === true) {{ $action['label'] }} @else {{ $action['label'] }} @endif
@endif