LockedVote.tsx 928 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2017-2020 @polkadot/react-components 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 { AccountId, AccountIndex, Address } from '@polkadot/types/interfaces';
  5. import React from 'react';
  6. import { LockedVote } from '@polkadot/react-query';
  7. import { classes } from './util';
  8. export interface Props {
  9. className?: string;
  10. label?: React.ReactNode;
  11. params?: AccountId | AccountIndex | Address | string | Uint8Array | null;
  12. withLabel?: boolean;
  13. }
  14. function LockedVoteDisplay (props: Props): React.ReactElement<Props> | null {
  15. const { className = '', label, params } = props;
  16. if (!params) {
  17. return null;
  18. }
  19. return (
  20. <LockedVote
  21. className={classes('ui--LockedVote', className)}
  22. label={label}
  23. params={params}
  24. />
  25. );
  26. }
  27. export default React.memo(LockedVoteDisplay);