export const LANGUAGE_LABEL_KEYS = {
    zh: 'zh',
    en: 'en',
    ja: 'ja',
    ko: 'ko',
    fr: 'fr',
    de: 'de',
    es: 'es',
    ru: 'ru',
    it: 'it',
    pt: 'pt',
    ar: 'ar',
    hi: 'hi',
    id: 'id',
    vi: 'vi',
    th: 'th',
    tr: 'tr',
    nl: 'nl',
    pl: 'pl',
    sv: 'sv',
    no: 'no',
    da: 'da',
    fi: 'fi',
    he: 'he',
    uk: 'uk',
    cs: 'cs',
    el: 'el',
    ro: 'ro',
    hu: 'hu',
    sk: 'sk',
    sl: 'sl',
    bg: 'bg',
    hr: 'hr',
    sr: 'sr',
    fa: 'fa',
    ur: 'ur',
    bn: 'bn',
    ms: 'ms',
    fil: 'fil',
    ta: 'ta',
    te: 'te',
    mr: 'mr',
    pa: 'pa',
    gu: 'gu',
    kn: 'kn',
    ml: 'ml',
    sw: 'sw',
} as const;

export type LanguageKey = keyof typeof LANGUAGE_LABEL_KEYS;

export const LANGUAGES: Array<{ id: string; key: LanguageKey; labelKey: string }> = [
    { id: '6643934087000', key: 'zh', labelKey: LANGUAGE_LABEL_KEYS.zh },
    { id: '6643934087001', key: 'en', labelKey: LANGUAGE_LABEL_KEYS.en },
    { id: '6643934087002', key: 'ja', labelKey: LANGUAGE_LABEL_KEYS.ja },
    { id: '6643934087003', key: 'ko', labelKey: LANGUAGE_LABEL_KEYS.ko },
    { id: '6643934087004', key: 'fr', labelKey: LANGUAGE_LABEL_KEYS.fr },
    { id: '6643934087005', key: 'de', labelKey: LANGUAGE_LABEL_KEYS.de },
    { id: '6643934087006', key: 'es', labelKey: LANGUAGE_LABEL_KEYS.es },
    { id: '6643934087007', key: 'ru', labelKey: LANGUAGE_LABEL_KEYS.ru },
    { id: '6643934087008', key: 'it', labelKey: LANGUAGE_LABEL_KEYS.it },
    { id: '6643934087009', key: 'pt', labelKey: LANGUAGE_LABEL_KEYS.pt },
    { id: '6643934087010', key: 'ar', labelKey: LANGUAGE_LABEL_KEYS.ar },
    { id: '6643934087011', key: 'hi', labelKey: LANGUAGE_LABEL_KEYS.hi },
    { id: '6643934087012', key: 'id', labelKey: LANGUAGE_LABEL_KEYS.id },
    { id: '6643934087013', key: 'vi', labelKey: LANGUAGE_LABEL_KEYS.vi },
    { id: '6643934087014', key: 'th', labelKey: LANGUAGE_LABEL_KEYS.th },
    { id: '6643934087015', key: 'tr', labelKey: LANGUAGE_LABEL_KEYS.tr },
    { id: '6643934087016', key: 'nl', labelKey: LANGUAGE_LABEL_KEYS.nl },
    { id: '6643934087017', key: 'pl', labelKey: LANGUAGE_LABEL_KEYS.pl },
    { id: '6643934087018', key: 'sv', labelKey: LANGUAGE_LABEL_KEYS.sv },
    { id: '6643934087019', key: 'no', labelKey: LANGUAGE_LABEL_KEYS.no },
    { id: '6643934087020', key: 'da', labelKey: LANGUAGE_LABEL_KEYS.da },
    { id: '6643934087021', key: 'fi', labelKey: LANGUAGE_LABEL_KEYS.fi },
    { id: '6643934087022', key: 'he', labelKey: LANGUAGE_LABEL_KEYS.he },
    { id: '6643934087023', key: 'uk', labelKey: LANGUAGE_LABEL_KEYS.uk },
    { id: '6643934087024', key: 'cs', labelKey: LANGUAGE_LABEL_KEYS.cs },
    { id: '6643934087025', key: 'el', labelKey: LANGUAGE_LABEL_KEYS.el },
    { id: '6643934087026', key: 'ro', labelKey: LANGUAGE_LABEL_KEYS.ro },
    { id: '6643934087027', key: 'hu', labelKey: LANGUAGE_LABEL_KEYS.hu },
    { id: '6643934087028', key: 'sk', labelKey: LANGUAGE_LABEL_KEYS.sk },
    { id: '6643934087029', key: 'sl', labelKey: LANGUAGE_LABEL_KEYS.sl },
    { id: '6643934087030', key: 'bg', labelKey: LANGUAGE_LABEL_KEYS.bg },
    { id: '6643934087031', key: 'hr', labelKey: LANGUAGE_LABEL_KEYS.hr },
    { id: '6643934087032', key: 'sr', labelKey: LANGUAGE_LABEL_KEYS.sr },
    { id: '6643934087033', key: 'fa', labelKey: LANGUAGE_LABEL_KEYS.fa },
    { id: '6643934087034', key: 'ur', labelKey: LANGUAGE_LABEL_KEYS.ur },
    { id: '6643934087035', key: 'bn', labelKey: LANGUAGE_LABEL_KEYS.bn },
    { id: '6643934087036', key: 'ms', labelKey: LANGUAGE_LABEL_KEYS.ms },
    { id: '6643934087037', key: 'fil', labelKey: LANGUAGE_LABEL_KEYS.fil },
    { id: '6643934087038', key: 'ta', labelKey: LANGUAGE_LABEL_KEYS.ta },
    { id: '6643934087039', key: 'te', labelKey: LANGUAGE_LABEL_KEYS.te },
    { id: '6643934087040', key: 'mr', labelKey: LANGUAGE_LABEL_KEYS.mr },
    { id: '6643934087041', key: 'pa', labelKey: LANGUAGE_LABEL_KEYS.pa },
    { id: '6643934087042', key: 'gu', labelKey: LANGUAGE_LABEL_KEYS.gu },
    { id: '6643934087043', key: 'kn', labelKey: LANGUAGE_LABEL_KEYS.kn },
    { id: '6643934087044', key: 'ml', labelKey: LANGUAGE_LABEL_KEYS.ml },
    { id: '6643934087045', key: 'sw', labelKey: LANGUAGE_LABEL_KEYS.sw },
];

export function getTranslatedLanguages(translate: (key: string) => string) {
    return LANGUAGES.map(lang => ({
        ...lang,
        label: translate(lang.labelKey),
    }));
}
