import { shell } from 'electron' import React from 'react' import PropTypes from 'prop-types' import ReactModal from 'react-modal' import styles from './ChannelModal.scss' const ChannelModal = ({ isOpen, resetChannel, channel, explorerLinkBase, closeChannel }) => { const customStyles = { overlay: { cursor: 'pointer', overflowY: 'auto' }, content: { top: 'auto', left: '20%', right: '0', bottom: 'auto', width: '40%', margin: '50px auto', padding: '40px' } } const closeChannelClicked = () => { closeChannel({ channel_point: channel.channel_point }) resetChannel(null) } return ( resetChannel(null)} parentSelector={() => document.body} style={customStyles} > { channel ?

{channel.remote_pubkey}

shell.openExternal(`${explorerLinkBase}/tx/${channel.channel_point.split(':')[0]}`)} > {channel.channel_point}

{channel.capacity}

Capacity

{channel.local_balance}

Local

{channel.remote_balance}

Remote
Sent
{channel.total_satoshis_sent}
Received
{channel.total_satoshis_received}
Updates
{channel.num_updates}
Close channel
: null }
) } ChannelModal.propTypes = { isOpen: PropTypes.bool.isRequired, resetChannel: PropTypes.func.isRequired, channel: PropTypes.object, explorerLinkBase: PropTypes.string.isRequired, closeChannel: PropTypes.func.isRequired } export default ChannelModal