ghost-portal/packages/react-components/src/Nonce.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

30 lines
740 B
TypeScript

// Copyright 2017-2020 @polkadot/react-components authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React from 'react';
import type { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
import { Nonce } from '@polkadot/react-query';
export interface Props {
className?: string;
label?: React.ReactNode;
params?: AccountId | AccountIndex | Address | string | Uint8Array | null;
}
function NonceDisplay ({ className = '', label, params }: Props): React.ReactElement<Props> | null {
if (!params) {
return null;
}
return (
<Nonce
className={`ui--Nonce ${className}`}
label={label}
params={params.toString()}
/>
);
}
export default React.memo(NonceDisplay);