import React from 'react' import PropTypes from 'prop-types' import { FaCircle } from 'react-icons/lib/fa' import { btc } from 'utils' import styles from './Channel.scss' const Channel = ({ ticker, channel, closeChannel, currentTicker }) => (
  • Open { channel.active ? Active : Not Active }

    closeChannel({ channel_point: channel.channel_point })} > Close channel

    Remote Pubkey

    {channel.remote_pubkey}

    Channel Point

    {channel.channel_point}

    Capacity

    { ticker.currency === 'btc' ? btc.satoshisToBtc(channel.capacity) : btc.satoshisToUsd(channel.capacity, currentTicker.price_usd) }

    Local

    { ticker.currency === 'btc' ? btc.satoshisToBtc(channel.local_balance) : btc.satoshisToUsd(channel.local_balance, currentTicker.price_usd) }

    Remote

    { ticker.currency === 'btc' ? btc.satoshisToBtc(channel.remote_balance) : btc.satoshisToUsd(channel.remote_balance, currentTicker.price_usd) }

  • ) Channel.propTypes = { ticker: PropTypes.object.isRequired, channel: PropTypes.object.isRequired, closeChannel: PropTypes.func.isRequired, currentTicker: PropTypes.object.isRequired } export default Channel