Members.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2017-2019 @polkadot/app-tech-comm 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 } from '@polkadot/types/interfaces';
  5. import { I18nProps } from '@polkadot/react-components/types';
  6. import React from 'react';
  7. import { AddressSmall, Table } from '@polkadot/react-components';
  8. import translate from '../translate';
  9. interface Props extends I18nProps {
  10. members?: AccountId[];
  11. className?: string;
  12. }
  13. function Members ({ className, members, t }: Props): React.ReactElement<Props> {
  14. return (
  15. <div className={className}>
  16. {members?.length
  17. ? (
  18. <Table>
  19. <Table.Body>
  20. {members.map((accountId): React.ReactNode => (
  21. <tr key={accountId.toString()}>
  22. <td>
  23. <AddressSmall value={accountId} />
  24. </td>
  25. </tr>
  26. ))}
  27. </Table.Body>
  28. </Table>
  29. )
  30. : t('No members found')
  31. }
  32. </div>
  33. );
  34. }
  35. export default translate(Members);