<?php

namespace App\Enums;

enum ContestStatusEnum: string
{
    /**
     * Enum representing the status of a contest.
     *
     * @var string
     */
    case DRAFT = 'draft';

    case UPCOMING = 'upcoming';

    case RUNNING = 'running';

    case COMPLETED = 'completed';

    public function label(): string
    {
        return match ($this) {
            self::DRAFT => 'Draft',
            self::UPCOMING => 'Upcoming',
            self::RUNNING => 'Running',
            self::COMPLETED => 'Completed',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::DRAFT => 'info',
            self::UPCOMING => 'warning',
            self::RUNNING => 'success',
            self::COMPLETED => 'danger',
        };
    }

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