package fr.titionfire.ffsaf.utils;

import fr.titionfire.ffsaf.domain.service.TradService;
import io.quarkus.runtime.annotations.RegisterForReflection;

import java.util.HashMap;

@RegisterForReflection
public enum Contact {
    COURRIEL,
    TELEPHONE,
    SITE,
    FACEBOOK,
    INSTAGRAM,
    AUTRE;

    public String getName(TradService trad) {
        return switch (this) {
            case COURRIEL -> trad.translate("Contact.COURRIEL");
            case TELEPHONE -> trad.translate("Contact.TELEPHONE");
            case SITE -> trad.translate("Contact.SITE");
            case FACEBOOK -> trad.translate("Contact.FACEBOOK");
            case INSTAGRAM -> trad.translate("Contact.INSTAGRAM");
            case AUTRE -> trad.translate("Contact.AUTRE");
        };
    }

    public static HashMap<String, String> toSite(TradService trad) {
        HashMap<String, String> map = new HashMap<>();
        for (Contact contact : Contact.values()) {
            map.put(contact.toString(), contact.getName(trad));
        }
        return map;
    }
}
