import { useMemo } from 'react';

import { localeData } from './data';
import { useLocaleStore } from './store';

export const useLocale = () => useLocaleStore((state) => state.lang);
export const useLocaleChange = () => useLocaleStore((state) => state.changeLang);
export const useLocaleData = () => {
    const lang = useLocale();
    return useMemo(() => localeData[lang], [lang]);
};
