Colored badges for status

This commit is contained in:
Matt Young 2026-01-28 03:47:49 -06:00
parent f066abd0d7
commit 63e32ded8a
2 changed files with 11 additions and 1 deletions

View File

@ -6,4 +6,12 @@ enum ClientStatus: string
{ {
case ACTIVE = 'active'; case ACTIVE = 'active';
case INACTIVE = 'inactive'; case INACTIVE = 'inactive';
public function color(): string
{
return match ($this) {
self::ACTIVE => 'green',
self::INACTIVE => 'zinc',
};
}
} }

View File

@ -63,7 +63,9 @@ new class extends Component {
<flux:table.cell>{{ $client->abbreviation }}</flux:table.cell> <flux:table.cell>{{ $client->abbreviation }}</flux:table.cell>
<flux:table.cell>{{ $client->audition_date->local()->format('m/d/Y') }}</flux:table.cell> <flux:table.cell>{{ $client->audition_date->local()->format('m/d/Y') }}</flux:table.cell>
<flux:table.cell> <flux:table.cell>
{{ $client->status }} <flux:badge :color="$client->status->color()">
{{ $client->status->value }}
</flux:badge>
</flux:table.cell> </flux:table.cell>
<flux:table.cell>{{ $client->created_at->local()->format('m/d/Y | g:i A') }}</flux:table.cell> <flux:table.cell>{{ $client->created_at->local()->format('m/d/Y | g:i A') }}</flux:table.cell>
</flux:table.row> </flux:table.row>