<?php

declare(strict_types=1);

namespace App\Domain\Ssl\Enums;

enum SslStatus: string
{
    case Pending = 'pending';
    case Provisioning = 'provisioning';
    case Active = 'active';
    case Expired = 'expired';
    case Error = 'error';
    case Renewing = 'renewing';

    public function label(): string
    {
        return match ($this) {
            self::Pending => 'Bekliyor',
            self::Provisioning => 'Sertifika Alınıyor',
            self::Active => 'Aktif',
            self::Expired => 'Süresi Doldu',
            self::Error => 'Hata',
            self::Renewing => 'Yenileniyor',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::Active => 'green',
            self::Pending, self::Provisioning, self::Renewing => 'amber',
            self::Expired, self::Error => 'red',
        };
    }
}
