<?php

namespace App\Domain\WhatsApp\Enums;

enum MessageStatus: string
{
    case Pending = 'pending';
    case Sent = 'sent';
    case Delivered = 'delivered';
    case Read = 'read';
    case Failed = 'failed';

    public function label(): string
    {
        return match ($this) {
            self::Pending => 'قيد الإرسال',
            self::Sent => 'مُرسل',
            self::Delivered => 'تم التسليم',
            self::Read => 'مقروء',
            self::Failed => 'فشل',
        };
    }

    public function color(): string
    {
        return match ($this) {
            self::Pending => 'gray',
            self::Sent => 'blue',
            self::Delivered => 'indigo',
            self::Read => 'green',
            self::Failed => 'red',
        };
    }
}
