@props([ 'state' => 'empty', 'message' => null, 'hint' => null, 'createRoute' => null, 'createLabel' => 'Add New', 'resetUrl' => null, 'errorDetails' => null, ]) @php switch ($state) { case 'no-results': $icon = 'fa-search'; $title = $message ?: 'No matching records'; $hint = $hint ?: 'Try a different search term or clear the filter.'; break; case 'loading': $icon = 'fa-spinner fa-spin'; $title = $message ?: 'Loading…'; $hint = $hint ?: ''; break; case 'error': $icon = 'fa-exclamation-triangle'; $title = $message ?: 'Something went wrong'; $hint = $hint ?: 'Please try again later.'; break; case 'empty': default: $icon = 'fa-inbox'; $title = $message ?: 'No records yet'; $hint = $hint ?: 'Get started by adding your first record.'; break; } @endphp

{{ $title }}

@if($hint)

{{ $hint }}

@endif @if($state === 'error' && $errorDetails)
{{ $errorDetails }}
@endif
@if($state === 'no-results' && $resetUrl) Clear filters @endif @if($state === 'empty' && $createRoute) {{ $createLabel }} @endif @if($state === 'error' && $resetUrl) Retry @endif