Files
bigcapital/packages/webapp/src/components/AppIntlProvider.tsx
2023-02-03 01:02:31 +02:00

27 lines
546 B
TypeScript

// @ts-nocheck
import React, { createContext } from 'react';
const AppIntlContext = createContext();
/**
* Application intl provider.
*/
function AppIntlProvider({ currentLocale, isRTL, children }) {
const provider = {
currentLocale,
isRTL,
isLTR: !isRTL,
direction: isRTL ? 'rtl' : 'ltr',
};
return (
<AppIntlContext.Provider value={provider}>
{children}
</AppIntlContext.Provider>
);
}
const useAppIntlContext = () => React.useContext(AppIntlContext);
export { AppIntlProvider, useAppIntlContext };