You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.9 KiB
67 lines
1.9 KiB
8 years ago
|
import React from 'react'
|
||
|
import PropTypes from 'prop-types'
|
||
7 years ago
|
import { btc } from 'utils'
|
||
8 years ago
|
import styles from './Channel.scss'
|
||
|
|
||
7 years ago
|
const Channel = ({ ticker, channel, setChannel, currentTicker }) => (
|
||
8 years ago
|
<li className={styles.channel} onClick={() => setChannel(channel)}>
|
||
|
<h1 className={styles.status}>Status: Open</h1>
|
||
|
<div className={styles.left}>
|
||
|
<section className={styles.remotePubkey}>
|
||
|
<span>Remote Pubkey</span>
|
||
|
<h4>{channel.remote_pubkey}</h4>
|
||
|
</section>
|
||
|
<section className={styles.channelPoint}>
|
||
|
<span>Channel Point</span>
|
||
|
<h4>{channel.channel_point}</h4>
|
||
|
</section>
|
||
|
</div>
|
||
|
<div className={styles.right}>
|
||
|
<section className={styles.capacity}>
|
||
|
<span>Capacity</span>
|
||
|
<h2>
|
||
|
{
|
||
|
ticker.currency === 'btc' ?
|
||
|
btc.satoshisToBtc(channel.capacity)
|
||
8 years ago
|
:
|
||
7 years ago
|
btc.satoshisToUsd(channel.capacity, currentTicker.price_usd)
|
||
8 years ago
|
}
|
||
|
</h2>
|
||
|
</section>
|
||
|
<div className={styles.balances}>
|
||
|
<section>
|
||
|
<h4>
|
||
|
{
|
||
|
ticker.currency === 'btc' ?
|
||
|
btc.satoshisToBtc(channel.local_balance)
|
||
8 years ago
|
:
|
||
7 years ago
|
btc.satoshisToUsd(channel.local_balance, currentTicker.price_usd)
|
||
8 years ago
|
}
|
||
8 years ago
|
</h4>
|
||
|
<span>Local</span>
|
||
|
</section>
|
||
|
<section>
|
||
|
<h4>
|
||
|
{
|
||
|
ticker.currency === 'btc' ?
|
||
|
btc.satoshisToBtc(channel.remote_balance)
|
||
8 years ago
|
:
|
||
7 years ago
|
btc.satoshisToUsd(channel.remote_balance, currentTicker.price_usd)
|
||
8 years ago
|
}
|
||
|
</h4>
|
||
|
<span>Remote</span>
|
||
|
</section>
|
||
|
</div>
|
||
|
</div>
|
||
|
</li>
|
||
|
)
|
||
8 years ago
|
|
||
8 years ago
|
Channel.propTypes = {
|
||
|
ticker: PropTypes.object.isRequired,
|
||
|
channel: PropTypes.object.isRequired,
|
||
7 years ago
|
setChannel: PropTypes.func.isRequired,
|
||
|
currentTicker: PropTypes.object.isRequired
|
||
8 years ago
|
}
|
||
8 years ago
|
|
||
8 years ago
|
export default Channel
|