ghost-portal/packages/app-council/src/Overview/Member.tsx
Jaco Greeff 5ec79faa4a
Add fav & current as nominations (#1869)
* Add fav & current as nominations

* Toggle nominee at end

* Selection icons for council
2019-11-11 23:35:00 +01:00

42 lines
1.1 KiB
TypeScript

// Copyright 2017-2019 @polkadot/app-democracy 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 { I18nProps } from '@polkadot/react-components/types';
import { AccountId } from '@polkadot/types/interfaces';
import React from 'react';
import { AddressCard, Badge, Icon } from '@polkadot/react-components';
import translate from '../translate';
import Voters from './Voters';
interface Props extends I18nProps {
address: AccountId;
voters?: AccountId[];
}
function Member ({ address, t, voters }: Props): React.ReactElement<Props> {
return (
<AddressCard
defaultName={t('council member')}
iconInfo={
<Badge
hover={t('Current member')}
info={<Icon name='check' />}
isTooltip
type='selected'
/>
}
value={address}
withIndexOrAddress
>
{voters && voters.length !== 0 && (
<Voters voters={voters} />
)}
</AddressCard>
);
}
export default translate(Member);