import { useContext, useMemo } from 'react';
import I18nContext from './I18nContext';
export function useComponentI18nData(componentName) {
    var ctx = useContext(I18nContext);
    return useMemo(function () {
        var i18n = ctx[componentName];
        return (typeof i18n === 'function'
            ? i18n()
            : i18n);
    }, [ctx, componentName]);
}
