Initial commit
This commit is contained in:
27
resources/views/components/issue/status-badge.blade.php
Normal file
27
resources/views/components/issue/status-badge.blade.php
Normal file
@@ -0,0 +1,27 @@
|
||||
@props(['status', 'label' => null])
|
||||
|
||||
@php
|
||||
$colors = [
|
||||
'new' => 'bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200',
|
||||
'assigned' => 'bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200',
|
||||
'in_progress' => 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200',
|
||||
'review' => 'bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200',
|
||||
'closed' => 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200',
|
||||
];
|
||||
|
||||
$icons = [
|
||||
'new' => '●',
|
||||
'assigned' => '◐',
|
||||
'in_progress' => '◔',
|
||||
'review' => '◕',
|
||||
'closed' => '✓',
|
||||
];
|
||||
|
||||
$colorClass = $colors[$status] ?? 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200';
|
||||
$icon = $icons[$status] ?? '●';
|
||||
@endphp
|
||||
|
||||
<span {{ $attributes->merge(['class' => "inline-flex items-center gap-1 rounded-full px-2 py-1 text-xs font-medium {$colorClass}"]) }}>
|
||||
<span aria-hidden="true">{{ $icon }}</span>
|
||||
<span>{{ $label ?? __(ucfirst(str_replace('_', ' ', $status))) }}</span>
|
||||
</span>
|
||||
Reference in New Issue
Block a user