-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Proposal.tsx
56 lines (50 loc) · 1.63 KB
/
Proposal.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// 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 { DerivedTreasuryProposal } from '@polkadot/api-derive/types';
import { I18nProps } from '@polkadot/react-components/types';
import React from 'react';
import { AddressMini, AddressSmall } from '@polkadot/react-components';
import { FormatBalance } from '@polkadot/react-query';
import { formatNumber } from '@polkadot/util';
import translate from '../translate';
import Voting from './Voting';
interface Props extends I18nProps {
isApproved?: boolean;
proposal: DerivedTreasuryProposal;
onRespond: () => void;
}
function ProposalDisplay ({ className, proposal: { council, id, proposal }, t }: Props): React.ReactElement<Props> | null {
return (
<tr className={className}>
<td className='number top'>
<h1>{formatNumber(id)}</h1>
</td>
<td>
<AddressSmall value={proposal.proposer} />
</td>
<td className='top'>
<FormatBalance
label={<label>{t('bond')}</label>}
value={proposal.bond}
/>
</td>
<td className='top'>
<AddressMini
label={<label>{t('beneficiary')}</label>}
value={proposal.beneficiary}
/>
</td>
<td className='top'>
<FormatBalance
label={<label>{t('value')}</label>}
value={proposal.value}
/>
</td>
<td className='top number together'>
<Voting proposals={council} />
</td>
</tr>
);
}
export default translate(ProposalDisplay);