import { isNil } from 'lodash';
import { FC, ReactNode } from 'react';

import { useLocaleChange } from './hooks';
import { LangType } from './types';

const Locale: FC<{ children?: ReactNode } & { lang: `${LangType}` }> = ({ children, lang }) => {
    const changeLocale = useLocaleChange();
    if (!isNil(changeLocale)) changeLocale(lang);
    return <>{children}</>;
};
export default Locale;
