{{-- Server Status Indicator Component - LucentUI Theme Migrated from AdminLTE to Tailwind Usage: --}} @props([ 'status', 'showLabel' => true, 'size' => 'md', 'minimal' => false, ]) @php $statusConfig = [ 'running' => [ 'color' => 'success', 'label' => 'Running', 'pulse' => true, ], 'stopped' => [ 'color' => 'muted', 'label' => 'Stopped', 'pulse' => false, ], 'paused' => [ 'color' => 'warning', 'label' => 'Paused', 'pulse' => false, ], 'suspended' => [ 'color' => 'warning', 'label' => 'Suspended', 'pulse' => false, ], 'migrating' => [ 'color' => 'info', 'label' => 'Migrating', 'pulse' => true, ], 'starting' => [ 'color' => 'info', 'label' => 'Starting', 'pulse' => true, ], 'stopping' => [ 'color' => 'warning', 'label' => 'Stopping', 'pulse' => true, ], 'unknown' => [ 'color' => 'danger', 'label' => 'Unknown', 'pulse' => false, ], ]; $config = $statusConfig[strtolower($status)] ?? $statusConfig['unknown']; $colorClasses = [ 'success' => 'text-success', 'warning' => 'text-yellow-600 dark:text-yellow-400', 'danger' => 'text-error', 'info' => 'text-info', 'muted' => 'text-secondary', ]; $bgClasses = [ 'success' => 'bg-success/10', 'warning' => 'bg-warning/15', 'danger' => 'bg-error/10', 'info' => 'bg-info/10', 'muted' => 'bg-neutral/20', ]; $dotClasses = [ 'success' => 'bg-success', 'warning' => 'bg-warning', 'danger' => 'bg-error', 'info' => 'bg-info', 'muted' => 'bg-neutral', ]; $sizeClasses = [ 'sm' => 'text-xs px-2 py-1', 'md' => 'text-xs px-2.5 py-1.5', 'lg' => 'text-sm px-3 py-2', ]; $dotSizeClasses = [ 'sm' => 'w-1.5 h-1.5', 'md' => 'w-2 h-2', 'lg' => 'w-2.5 h-2.5', ]; @endphp @if($minimal) {{-- Minimal dot-only variant --}}
class(['inline-flex items-center', $showLabel ? 'gap-1.5' : '']) }} > @if($config['pulse']) @endif @if($showLabel) {{ $config['label'] }} @endif
@else {{-- Full badge variant --}}
class([ 'inline-flex items-center gap-2 font-medium rounded-full', $bgClasses[$config['color']] ?? $bgClasses['muted'], $colorClasses[$config['color']] ?? $colorClasses['muted'], $sizeClasses[$size] ?? $sizeClasses['md'], ]) }} > @if($config['pulse']) @endif @if($showLabel) {{ $config['label'] }} @endif
@endif