ghost-portal/packages/react-query/src/Chain.tsx
Jaco 7d24f50c38
Bump deps (incl. TS) (#8931)
* Bump deps (incl. TS)

* Adjust ESM packages for Jest

* Yet more Jest hacks

* Make horrible jest config slightly prettier

* Unbump electron

* Fix external package deps
2023-02-03 15:01:45 +02:00

28 lines
655 B
TypeScript

// Copyright 2017-2023 @polkadot/react-query authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React from 'react';
import { useApi } from '@polkadot/react-hooks';
import { useTranslation } from './translate';
interface Props {
children?: React.ReactNode;
className?: string;
label?: React.ReactNode;
}
function Chain ({ children, className = '', label }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { systemChain } = useApi();
return (
<div className={className}>
{label || ''}{systemChain || t<string>('Unknown')}{children}
</div>
);
}
export default React.memo(Chain);