This repository has been archived by the owner on Apr 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathforgedBlocks.js
43 lines (40 loc) · 1.7 KB
/
forgedBlocks.js
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
import React from 'react';
import { Card, CardTitle } from 'react-toolbox/lib/card';
import { Table, TableHead, TableRow, TableCell } from 'react-toolbox/lib/table';
import { translate } from 'react-i18next';
import grid from 'flexboxgrid/dist/flexboxgrid.css';
import { TooltipTime } from '../timestamp';
import LiskAmount from '../liskAmount';
import FormattedNumber from '../formattedNumber';
import style from './forging.css';
const ForgedBlocks = props => (
<Card className={`${style.grayCard} ${grid['col-xs-12']} forged-blocks`}>
<CardTitle>
Forged Blocks
</CardTitle>
{ props.forgedBlocks.length ?
<div className={style.forgedBlocksTableWrapper}>
<Table selectable={false}>
<TableHead>
<TableCell>{props.t('Block height')}</TableCell>
<TableCell>{props.t('Block Id')}</TableCell>
<TableCell>{props.t('Timestamp')}</TableCell>
<TableCell>{props.t('Total fee')}</TableCell>
<TableCell>{props.t('Reward')}</TableCell>
</TableHead>
{props.forgedBlocks.map((block, idx) => (
<TableRow key={idx}>
<TableCell><FormattedNumber val={block.height} /></TableCell>
<TableCell>{block.id}</TableCell>
<TableCell><TooltipTime label={block.timestamp} /></TableCell>
<TableCell><LiskAmount val={block.totalFee} roundTo={2} /></TableCell>
<TableCell><LiskAmount val={block.reward} roundTo={2} /></TableCell>
</TableRow>
))}
</Table>
</div> :
<p className='hasPaddingRow empty-message'>{props.t('You have not forged any blocks yet')}.</p>
}
</Card>
);
export default translate()(ForgedBlocks);