<?php

namespace App\Enums;

enum ParticipantStatusEnum: string
{
    case PENDING = 'pending';

    case RUNNING = 'running';

    case SUBMITTED = 'submitted';

    case WON = 'won';

    case LOST = 'lost';

    public function label(): string
    {
        return match ($this) {
            self::PENDING => 'Pending',
            self::RUNNING => 'Running',
            self::SUBMITTED => 'Submitted',
            self::WON => 'Won',
            default => 'Unknown',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::PENDING => 'warning',
            self::RUNNING => 'info',
            self::SUBMITTED => 'success',
            self::WON => 'success',
            default => 'default',
        };
    }

    public static function values(): array
    {
        return array_column(self::cases(), 'value');
    }
}
