ghost-portal/packages/page-tech-comm/src/Overview/Members.tsx
Jaco Greeff c60ba8708a
Bumps w/ eslint (#2802)
* Bumps w/ eslint

* Additional

* Additional

* Additional

* Additional

* Remove style props

* Additional

* Additional

* Additional

* Additional (< 100)

* eslint passes, tsc next

* tsc fixes

* Update deps

* Update i18n
2020-05-24 19:41:14 +02:00

53 lines
1.4 KiB
TypeScript

// Copyright 2017-2020 @polkadot/app-tech-comm authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { AccountId } from '@polkadot/types/interfaces';
import React, { useMemo } from 'react';
import { AddressSmall, Table, Tag } from '@polkadot/react-components';
import { useTranslation } from '../translate';
interface Props {
className?: string;
members?: string[];
prime?: AccountId | null;
}
function Members ({ className = '', members, prime }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const header = useMemo(() => [
[t('members'), 'start', 3]
], [t]);
return (
<Table
className={className}
empty={members && t<string>('No members found')}
header={header}
>
{members?.map((accountId): React.ReactNode => (
<tr key={accountId.toString()}>
<td className='address'>
<AddressSmall value={accountId} />
</td>
<td>
{prime?.eq(accountId) && (
<Tag
color='green'
hover={t<string>('Committee prime member, default voting')}
label={t<string>('prime member')}
/>
)}
</td>
<td className='all'>&nbsp;</td>
</tr>
))}
</Table>
);
}
export default React.memo(Members);