mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 19:39:27 +01:00
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Filament\Support\Contracts\HasColor;
|
|
use Filament\Support\Contracts\HasIcon;
|
|
use Filament\Support\Contracts\HasLabel;
|
|
use Illuminate\Support\Str;
|
|
|
|
enum PluginStatus: string implements HasColor, HasIcon, HasLabel
|
|
{
|
|
case NotInstalled = 'not_installed';
|
|
case Disabled = 'disabled';
|
|
case Enabled = 'enabled';
|
|
case Errored = 'errored';
|
|
|
|
public function getIcon(): string
|
|
{
|
|
return match ($this) {
|
|
self::NotInstalled => 'tabler-heart-off',
|
|
self::Disabled => 'tabler-heart-x',
|
|
self::Enabled => 'tabler-heart-check',
|
|
self::Errored => 'tabler-heart-broken',
|
|
};
|
|
}
|
|
|
|
public function getColor(): string
|
|
{
|
|
return match ($this) {
|
|
self::NotInstalled => 'gray',
|
|
self::Disabled => 'warning',
|
|
self::Enabled => 'success',
|
|
self::Errored => 'danger',
|
|
};
|
|
}
|
|
|
|
public function getLabel(): string
|
|
{
|
|
return Str::headline($this->name);
|
|
}
|
|
}
|