ghost-portal/packages/react-components/src/Available.tsx
Jaco Greeff e6d3c61176
Use type imports from @polkadot/types/interfaces (#4103)
* Move chain params to apps-config

* Use type imports from @polkadot/types/interfaces
2020-11-29 19:03:06 +01:00

32 lines
791 B
TypeScript

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