import { createContext, PropsWithChildren } from 'react';

import { DEFAULT_LOCALE } from '../../common/locale';

export const LanguageContext = createContext<string>(DEFAULT_LOCALE);

export type LanguageProviderProps = PropsWithChildren<{ locale: string }>;

export const LanguageProvider = ({ locale, children }: LanguageProviderProps) => {
  return <LanguageContext.Provider value={locale}>{children}</LanguageContext.Provider>;
};
