2018-03-26 23:32:43 +02:00
|
|
|
// @flow
|
2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
2018-03-26 23:32:43 +02:00
|
|
|
import CreditAmount from 'component/common/credit-amount';
|
2017-08-17 22:19:29 +02:00
|
|
|
|
2018-03-26 23:32:43 +02:00
|
|
|
type Props = {
|
|
|
|
balance: number,
|
|
|
|
};
|
|
|
|
|
|
|
|
const WalletBalance = (props: Props) => {
|
|
|
|
const { balance } = props;
|
2017-08-17 22:19:29 +02:00
|
|
|
return (
|
2018-03-26 23:32:43 +02:00
|
|
|
<section className="card card--section card--wallet-balance">
|
|
|
|
<div>
|
|
|
|
<div className="card__title">{__('Balance')}</div>
|
|
|
|
<span className="card__subtitle">{__('You currently have')}</span>
|
2017-08-17 22:19:29 +02:00
|
|
|
</div>
|
|
|
|
<div className="card__content">
|
2018-03-26 23:32:43 +02:00
|
|
|
{(balance || balance === 0) && <CreditAmount large amount={balance} precision={8} />}
|
2017-08-17 22:19:29 +02:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default WalletBalance;
|