<?php

namespace App\Enums;

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

enum SocialMedia: string implements HasLabel
{
    use WithComment;

    case PPID_DISKOMINFO_PURWAKARTA = 'PPID Diskominfo Purwakarta';
    case DISKOMINFO_PURWAKARTA = 'Diskominfo Purwakarta';
    case PURWAKARTA_SABER_HOAKS = 'Purwakarta Saber Hoaks';

    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();
    }
}
