Skip to content

Commit

Permalink
Feature/result hascolor (#1347)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Justesen <[email protected]>
  • Loading branch information
wdog and alexjustesen authored Apr 4, 2024
1 parent 2640b06 commit d22db76
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/Enums/ResultStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace App\Enums;

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;

enum ResultStatus: string implements HasLabel
enum ResultStatus: string implements HasColor, HasLabel
{
case Completed = 'completed'; // a speedtest that ran successfully.
case Failed = 'failed'; // a speedtest that failed to run successfully.
Expand All @@ -14,4 +15,13 @@ public function getLabel(): ?string
{
return $this->name;
}

public function getColor(): ?string
{
return match ($this) {
self::Completed => 'success',
self::Failed => 'danger',
self::Started => 'warning',
};
}
}

0 comments on commit d22db76

Please sign in to comment.