import { shell } from 'electron'
import React from 'react'
import PropTypes from 'prop-types'
import { btc } from 'utils'
import styles from './ChannelsList.scss'
const ChannelsList = ({ channels, updateSelectedChannels, selectedChannelIds }) => (
{
channels.map(channel => (
- updateSelectedChannels(channel)}>
Capacity: {btc.satoshisToBtc(channel.capacity)}
shell.openExternal(`https://testnet.smartbit.com.au/tx/${channel.channel_point.split(':')[0]}`)}>Channel Point
Remote Pubkey:
{channel.remote_pubkey.substring(0, Math.min(30, channel.remote_pubkey.length))}...
Sent:
{btc.satoshisToBtc(channel.total_satoshis_sent)} BTC
Received:
{btc.satoshisToBtc(channel.total_satoshis_received)} BTC
))
}
)
ChannelsList.propTypes = {
channels: PropTypes.array.isRequired,
updateSelectedChannels: PropTypes.func.isRequired,
selectedChannelIds: PropTypes.array.isRequired
}
export default ChannelsList