2021-02-04 19:15:23 +01:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import classnames from 'classnames';
|
2018-08-31 21:36:07 +02:00
|
|
|
|
|
|
|
export default class TransactionBreakdownRow extends PureComponent {
|
|
|
|
static propTypes = {
|
|
|
|
title: PropTypes.string,
|
|
|
|
children: PropTypes.node,
|
|
|
|
className: PropTypes.string,
|
2021-12-01 18:22:08 +01:00
|
|
|
divider: PropTypes.bool,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
2018-08-31 21:36:07 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
render() {
|
2021-12-01 18:22:08 +01:00
|
|
|
const { title, children, className, divider = false } = this.props;
|
2018-08-31 21:36:07 +02:00
|
|
|
|
|
|
|
return (
|
2021-09-08 20:06:16 +02:00
|
|
|
<div
|
2021-12-01 18:22:08 +01:00
|
|
|
className={classnames(
|
|
|
|
'transaction-breakdown-row',
|
|
|
|
divider ? 'transaction-breakdown-row--with-bottom-border' : '',
|
|
|
|
className,
|
|
|
|
)}
|
2021-09-08 20:06:16 +02:00
|
|
|
data-testid="transaction-breakdown-row"
|
|
|
|
>
|
|
|
|
<div
|
|
|
|
className="transaction-breakdown-row__title"
|
|
|
|
data-testid="transaction-breakdown-row-title"
|
|
|
|
>
|
|
|
|
{title}
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
className="transaction-breakdown-row__value"
|
|
|
|
data-testid="transaction-breakdown-row-value"
|
|
|
|
>
|
|
|
|
{children}
|
|
|
|
</div>
|
2018-08-31 21:36:07 +02:00
|
|
|
</div>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-08-31 21:36:07 +02:00
|
|
|
}
|
|
|
|
}
|