import React from 'react' import PropTypes from 'prop-types' import Zap from 'components/Icon/Zap' import { btc } from 'lib/utils' import Value from 'components/Value' import { FormattedNumber, FormattedTime, injectIntl } from 'react-intl' import messages from './messages' import styles from '../Activity.scss' const Payment = ({ payment, ticker, currentTicker, showActivityModal, nodes, currencyName, intl }) => { const displayNodeName = pubkey => { const node = nodes.find(n => pubkey === n.pub_key) if (node && node.alias.length) { return node.alias } return pubkey.substring(0, 10) } return (
showActivityModal('PAYMENT', payment.payment_hash)} >

{displayNodeName(payment.path[payment.path.length - 1])}

- {currencyName}
) } Payment.propTypes = { currencyName: PropTypes.string.isRequired, payment: PropTypes.object.isRequired, ticker: PropTypes.object.isRequired, currentTicker: PropTypes.object.isRequired, nodes: PropTypes.array.isRequired, showActivityModal: PropTypes.func.isRequired, intl: PropTypes.object.isRequired } export default injectIntl(Payment)