<?php

namespace App\Enums;

use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasLabel;
use Illuminate\Contracts\Support\Htmlable;

enum PaymentStatus: string implements HasColor, HasLabel
{
    case Pending = 'pending';
    case Completed = 'completed';
    case Failed = 'failed';
    case Cancelled = 'cancelled';

    public function getColor(): string|array|null
    {
        return match ($this) {
            self::Completed => 'success',
            self::Failed => 'danger',
            self::Cancelled => 'warning',
            default => 'primary',
        };
    }

    public function getLabel(): string|Htmlable|null
    {
        return $this->name;
    }
}
