mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 23:50:33 +00:00
50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace App\Filament\Enums;
|
||
|
|
||
|
use Filament\Support\Contracts\HasColor;
|
||
|
use Filament\Support\Contracts\HasIcon;
|
||
|
use Filament\Support\Contracts\HasLabel;
|
||
|
|
||
|
enum BackupStatus: string implements HasColor, HasIcon, HasLabel
|
||
|
{
|
||
|
case Pending = 'pending';
|
||
|
case Processing = 'processing';
|
||
|
case Completed = 'completed';
|
||
|
case Failed = 'failed';
|
||
|
case Cancelled = 'cancelled';
|
||
|
|
||
|
public function getLabel(): string
|
||
|
{
|
||
|
return match ($this) {
|
||
|
self::Pending => 'Pending',
|
||
|
self::Processing => 'Processing',
|
||
|
self::Completed => 'Completed',
|
||
|
self::Failed => 'Failed',
|
||
|
self::Cancelled => 'Cancelled',
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public function getColor(): string | array | null
|
||
|
{
|
||
|
return match ($this) {
|
||
|
self::Pending => 'info',
|
||
|
self::Cancelled => 'warning',
|
||
|
self::Processing => 'warning',
|
||
|
self::Completed => 'success',
|
||
|
self::Failed => 'danger',
|
||
|
};
|
||
|
}
|
||
|
|
||
|
public function getIcon(): ?string
|
||
|
{
|
||
|
return match ($this) {
|
||
|
self::Pending => 'heroicon-m-sparkles',
|
||
|
self::Processing => 'heroicon-m-arrow-path',
|
||
|
self::Cancelled => 'heroicon-m-truck',
|
||
|
self::Completed => 'heroicon-m-check-badge',
|
||
|
self::Failed => 'heroicon-m-x-circle',
|
||
|
};
|
||
|
}
|
||
|
}
|