<?php

namespace App\Enums;

use App\Traits\Enum\WithComment;
use App\Traits\Enum\WithValue;
use Filament\Support\Contracts\HasLabel;

enum SocialMedia: int implements HasLabel
{
    use WithComment, WithValue;

    case PPID_DISKOMINFO_PURWAKARTA = 1;
    case DISKOMINFO_PURWAKARTA = 2;
    case PURWAKARTA_SABER_HOAKS = 3;

    public function getLabel(): ?string
    {
        return match ($this) {
            self::PPID_DISKOMINFO_PURWAKARTA => 'PPID Diskominfo Purwakarta',
            self::DISKOMINFO_PURWAKARTA => 'Diskominfo Purwakarta',
            self::PURWAKARTA_SABER_HOAKS => 'Purwakarta Saber Hoaks',
        };
    }

    public static function options(): array
    {
        return collect(self::cases())
            ->mapWithKeys(fn ($case) => [$case->value => $case->getLabel()])
            ->toArray();
    }
}
