{{-- resources/views/admin/components/empty-state.blade.php --}} @php // Top-level props with sane defaults $icon = $icon ?? 'question-circle'; $title = $title ?? 'Nothing here yet'; $message = $message ?? ''; $hasAction = isset($action) && is_array($action) && !empty($action); // Backward-compatible action mapping // Accepts either: // ['text'=>..., 'icon'=>..., 'style'=>..., 'onclick'=>..., 'modal'=>...] // or legacy: // ['label'=>..., 'type'=>..., 'action'=>...] (maps to text/style/onclick) $actionText = $hasAction ? ($action['text'] ?? ($action['label'] ?? 'Action')) : null; $actionStyle = $hasAction ? ($action['style'] ?? ($action['type'] ?? 'primary')) : null; $actionIcon = $hasAction ? ($action['icon'] ?? 'plus') : null; $actionOnclick = $hasAction ? ($action['onclick']?? ($action['action'] ?? null)) : null; $actionModal = $hasAction ? ($action['modal'] ?? null) : null; @endphp
{{ e($title) }}
@if(!empty($message))

{{ e($message) }}

@endif @if($hasAction) @endif