import React from 'react';
import moment from 'moment';
import classnames from 'classnames';
class CurrencyLogo extends React.Component {
render = () => {
var className = classnames('bt', 'bt-' + this.props.currency.toLowerCase(), 'currency-logo');
return ;
}
}
var formatVariation = (variation) => {
var variationAbs = Math.abs(variation);
if (variation === 0.0) {
return {variationAbs}%;
} else if (variation > 0) {
return +{variationAbs}%;
}
return -{variationAbs}%;
};
class CurrencyRateHeader extends React.Component {
render = () => {
return
Asset
Position
Qty
Value (BTC)
Weight
Perf %
;
}
}
class CurrencyRate extends React.Component {
render = () => {
return
{this.props.currency}
{this.props.positionType}
{this.props.quantity}
{this.props.BTCValue}
{this.props.weight}%
{formatVariation(this.props.positionPerformanceP)}
;
}
}
class Assets extends React.Component {
render = () => {
var currencies = Object.keys(this.props.balances).map(function(currency) {
var balance = this.props.balances[currency];
balance.currency = currency;
return
;
}.bind(this));
return
{currencies}
;
}
}
class PFBalance extends React.Component {
render = () => {
var date = moment(this.props.periodStart).format('MMM Do, h:mma');
return
Current balance
{this.props.balance}
since {date}
{formatVariation(this.props.variationP)}
;
}
}
class PFBalanceMinimal extends React.Component {
render = () => {
return
{this.props.balance} {formatVariation(this.props.variationP)}
;
}
}
export {PFBalance, Assets, PFBalanceMinimal};