lbry-desktop/src/renderer/component/rewardListClaimed/view.jsx

55 lines
1.3 KiB
React
Raw Normal View History

2018-03-26 23:32:43 +02:00
// @flow
import React from 'react';
2018-03-26 23:32:43 +02:00
import ButtonTransaction from 'component/common/transaction-link';
2018-03-26 23:32:43 +02:00
type Reward = {
id: string,
reward_title: string,
reward_amount: number,
transaction_id: string,
created_at: string,
};
type Props = {
rewards: Array<Reward>,
};
const RewardListClaimed = (props: Props) => {
const { rewards } = props;
if (!rewards || !rewards.length) {
return null;
}
return (
2018-03-26 23:32:43 +02:00
<section className="card card--section">
<div className="card__title">Claimed Rewards</div>
<table className="card__content table table--stretch">
<thead>
<tr>
<th>{__('Title')}</th>
<th>{__('Amount')}</th>
<th>{__('Transaction')}</th>
<th>{__('Date')}</th>
</tr>
</thead>
<tbody>
{rewards.map(reward => (
<tr key={reward.id}>
<td>{reward.reward_title}</td>
<td>{reward.reward_amount}</td>
<td>
<ButtonTransaction id={reward.transaction_id} />
</td>
<td>{reward.created_at.replace('Z', ' ').replace('T', ' ')}</td>
</tr>
2018-03-26 23:32:43 +02:00
))}
</tbody>
</table>
</section>
);
};
export default RewardListClaimed;