Files
extension/packages/extension-mocks/src/react-i18next.ts
T
Jaco ca595cdfab 2024 (#1302)
* 2024

* 2024
2024-01-08 15:05:09 +02:00

25 lines
693 B
TypeScript

// Copyright 2019-2024 @polkadot/extension-mocks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type React from 'react';
interface useTranslationReturnObj {
i18n: { changeLanguage: () => Promise<unknown>; };
t: (str: string) => string;
}
export const useTranslation = (): useTranslationReturnObj => {
return {
i18n: {
changeLanguage: () => new Promise(() => { /**/ })
},
t: (str: string) => str
};
};
export const withTranslation = () => (component: React.ReactElement): React.ReactElement => component;
export const Trans = ({ children }: { children: React.ReactElement }): React.ReactElement => children;
export default withTranslation;