ghost-portal/packages/react-query/src/NodeName.tsx
Ewa Kowalska 87505b1c59
Eslint imports (#4037)
* Add eslint configuration

* Patch eslint plugin for sorting imports

* Apply eslint rules for imports
2020-12-01 14:40:42 +01:00

25 lines
554 B
TypeScript

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