ghost-keychain/packages/extension-ui/src/components/Loading.tsx
Jaco Greeff 206c0b4d85
Swap to actual react-i18next (#431)
* Swap to actual react-i18next

* Update i18n creation
2020-09-04 16:32:42 +02:00

26 lines
581 B
TypeScript

// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import React from 'react';
import useTranslation from '../hooks/useTranslation';
interface Props {
children?: React.ReactNode;
}
export default function Loading ({ children }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
if (!children) {
return (
<div>{t<string>('... loading ...')}</div>
);
}
return (
<>{children}</>
);
}