NodeVersion.tsx 655 B

123456789101112131415161718192021222324
  1. // Copyright 2017-2020 @polkadot/react-query authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. import React from 'react';
  5. import { useApi } from '@polkadot/react-hooks';
  6. interface Props {
  7. children?: React.ReactNode;
  8. className?: string;
  9. label?: React.ReactNode;
  10. }
  11. function NodeVersion ({ children, className = '', label }: Props): React.ReactElement<Props> {
  12. const { systemVersion } = useApi();
  13. return (
  14. <div className={className}>
  15. {label || ''}{systemVersion}{children}
  16. </div>
  17. );
  18. }
  19. export default React.memo(NodeVersion);