<?php

namespace App\Enums;

enum AppStatus: int
{
    case INSTALLED = 0;
    case ENABLED = 1;
    case DISABLED = 2;

    public function label(): string
    {
        return match ($this) {
            self::INSTALLED => '已安装',
            self::ENABLED => '已启用',
            self::DISABLED => '已禁用',
        };
    }

    public function badge(): string
    {
        return match ($this) {
            self::INSTALLED => 'warning',
            self::ENABLED => 'success',
            self::DISABLED => 'danger',
        };
    }
}
