Skip to content

Commit

Permalink
Update ServiceStatus.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Dec 6, 2024
1 parent 3fbd582 commit 244b697
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions web/Modules/Email/App/Enums/ServiceStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,28 @@

namespace Modules\Email\App\Enums;

enum ServiceStatus: string
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;

enum ServiceStatus: string implements HasLabel, HasColor
{
case ACTIVE = 'Active';
case RUNNING = 'Running';
case NOT_RUNNING = 'NotRunning';

case INACTIVE = 'Inactive';

public function color(): string
public function getLabel(): ?string
{
return match ($this) {
self::ACTIVE => 'Active',
self::INACTIVE => 'Inactive',
self::RUNNING => 'Running',
self::NOT_RUNNING => 'Not Running',
};
}

public function getColor(): string | array | null
{
return match ($this) {
self::ACTIVE => 'success',
Expand Down

0 comments on commit 244b697

Please sign in to comment.