import { shell } from 'electron'
import React from 'react'
import PropTypes from 'prop-types'
import { btc } from 'utils'
import styles from './OpenPendingChannel.scss'
const OpenPendingChannel = ({ ticker, channel, currentTicker, explorerLinkBase }) => (
shell.openExternal(`${explorerLinkBase}/tx/${channel.channel.channel_point.split(':')[0]}`)}>
Opening Channel...
Blocks till open: {channel.blocks_till_open}
Remote Pubkey
{channel.channel.remote_node_pub}
Channel Point
{channel.channel.channel_point}
Capacity
{
ticker.currency === 'btc' ?
btc.satoshisToBtc(channel.channel.capacity)
:
btc.satoshisToUsd(channel.channel.capacity, currentTicker.price_usd)
}
{
ticker.currency === 'btc' ?
btc.satoshisToBtc(channel.channel.local_balance)
:
btc.satoshisToUsd(channel.channel.local_balance, currentTicker.price_usd)
}
Local
{
ticker.currency === 'btc' ?
btc.satoshisToBtc(channel.channel.remote_balance)
:
btc.satoshisToUsd(channel.channel.remote_balance, currentTicker.price_usd)
}
Remote
)
OpenPendingChannel.propTypes = {
ticker: PropTypes.object.isRequired,
channel: PropTypes.object.isRequired,
currentTicker: PropTypes.object.isRequired,
explorerLinkBase: PropTypes.string.isRequired
}
export default OpenPendingChannel