@props([ 'status' => 'pending', 'size' => 'default', 'showText' => true, 'text' => null ]) @php $statusConfig = [ 'pending' => [ 'color' => 'warning', 'icon' => 'clock', 'text' => 'En attente' ], 'in_progress' => [ 'color' => 'info', 'icon' => 'loader', 'text' => 'En cours' ], 'completed' => [ 'color' => 'success', 'icon' => 'check-circle', 'text' => 'Terminé' ], 'cancelled' => [ 'color' => 'danger', 'icon' => 'x-circle', 'text' => 'Annulé' ], 'ready' => [ 'color' => 'primary', 'icon' => 'file-check', 'text' => 'Prêt' ] ]; $config = $statusConfig[$status] ?? $statusConfig['pending']; $displayText = $text ?? $config['text']; $sizeClasses = [ 'sm' => 'badge-sm', 'default' => '', 'lg' => 'fs-6 px-3 py-2' ]; $sizeClass = $sizeClasses[$size] ?? $sizeClasses['default']; @endphp merge(['class' => "badge bg-{$config['color']}-subtle text-{$config['color']}-emphasis border border-{$config['color']}-subtle rounded-pill d-inline-flex align-items-center {$sizeClass}"]) }}> @if($showText) {{ $displayText }} @endif