mirror of
https://github.com/openclassify/openclassify.git
synced 2026-04-14 11:12:09 -05:00
39 lines
893 B
PHP
39 lines
893 B
PHP
<?php
|
|
|
|
namespace Modules\Video\Enums;
|
|
|
|
enum VideoStatus: string
|
|
{
|
|
case Pending = 'pending';
|
|
case Processing = 'processing';
|
|
case Ready = 'ready';
|
|
case Failed = 'failed';
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::Pending => 'Queued',
|
|
self::Processing => 'Processing',
|
|
self::Ready => 'Ready',
|
|
self::Failed => 'Failed',
|
|
};
|
|
}
|
|
|
|
public function color(): string
|
|
{
|
|
return match ($this) {
|
|
self::Pending => 'warning',
|
|
self::Processing => 'info',
|
|
self::Ready => 'success',
|
|
self::Failed => 'danger',
|
|
};
|
|
}
|
|
|
|
public static function options(): array
|
|
{
|
|
return collect(self::cases())
|
|
->mapWithKeys(fn (self $status): array => [$status->value => $status->label()])
|
|
->all();
|
|
}
|
|
}
|