<?php

namespace App\Enums;

use App\Traits\WithCommentEnum;
use App\Traits\WithValueEnum;

enum ArticleStatus: int
{
    use WithCommentEnum, WithValueEnum;

    case PUBLISHED = 1;
    case DRAFT = 2;
    case ARCHIVED = 3;

    public function label()
    {
        return match ($this) {
            self::PUBLISHED => 'Publish',
            self::DRAFT => 'Draft',
            self::ARCHIVED => 'Arsip',
        };
    }

    public function color()
    {
        return match ($this) {
            self::PUBLISHED => 'emerald',
            self::DRAFT => 'yellow',
            self::ARCHIVED => 'rose',
        };
    }
}
