<?php

namespace App\Enums;

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

enum Channel: string implements HasLabel
{
    use WithComment;

    case WEBSITE = 'Website';
    case TIKTOK = 'Tiktok';
    case YOUTUBE = 'Youtube';
    case FACEBOOK = 'Facebook';
    case INSTAGRAM = 'Instagram';
    case OTHER = 'Other';

    public function getLabel(): ?string
    {
        return match ($this) {
            self::WEBSITE => 'Website',
            self::TIKTOK => 'Tiktok',
            self::YOUTUBE => 'Youtube',
            self::FACEBOOK => 'Facebook',
            self::INSTAGRAM => 'Instagram',
            self::OTHER => 'Other',
        };
    }

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