<?php

declare(strict_types=1);

namespace App\Application\LiveComponents\ValueObjects;

/**
 * SuggestionContext - Context for autocomplete suggestions
 */
enum SuggestionContext: string
{
    case GENERAL = 'general';
    case EMAIL = 'email';
    case LOCATION = 'location';
    case PRODUCT = 'product';

    public function getLabel(): string
    {
        return match ($this) {
            self::GENERAL => 'Allgemein',
            self::EMAIL => 'E-Mail Adressen',
            self::LOCATION => 'Orte',
            self::PRODUCT => 'Produkte'
        };
    }

    public function getIcon(): string
    {
        return match ($this) {
            self::GENERAL => '🔍',
            self::EMAIL => '📧',
            self::LOCATION => '🌍',
            self::PRODUCT => '🛍️'
        };
    }

    public function getPlaceholder(): string
    {
        return match ($this) {
            self::GENERAL => 'Suchbegriff eingeben...',
            self::EMAIL => 'E-Mail Adresse eingeben...',
            self::LOCATION => 'Stadt oder Land eingeben...',
            self::PRODUCT => 'Produktname eingeben...'
        };
    }

    public static function fromString(string $value): self
    {
        return match ($value) {
            'email' => self::EMAIL,
            'location' => self::LOCATION,
            'product' => self::PRODUCT,
            default => self::GENERAL
        };
    }
}
