'use client';
import { t } from '@payloadcms/translations';
import React, { createContext, useContext } from 'react';
const Context = /*#__PURE__*/ createContext({
    i18n: {
        fallbackLanguage: 'en',
        language: 'en',
        t: (key)=>key,
        translations: {}
    },
    languageOptions: undefined,
    t: (key)=>key
});
export const TranslationProvider = ({ children, fallbackLang, lang, languageOptions, translations })=>{
    const nextT = (key, vars)=>t({
            key,
            translations,
            vars
        });
    return /*#__PURE__*/ React.createElement(Context.Provider, {
        value: {
            i18n: {
                fallbackLanguage: fallbackLang,
                language: lang,
                t: nextT,
                translations: translations
            },
            languageOptions,
            t: nextT
        }
    }, children);
};
export const useTranslation = ()=>useContext(Context);

//# sourceMappingURL=index.js.map