import React from 'react' import PropTypes from 'prop-types' import Isvg from 'react-inlinesvg' import zap from 'icons/zap.svg' import { btc } from 'lib/utils' import Value from 'components/Value' import { 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} {currentTicker[ticker.fiatTicker].symbol} {btc.convert('sats', 'fiat', payment.value, currentTicker[ticker.fiatTicker].last)}
) } 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)