OSDN Git Service

add the peer information page.
[bytom/bytom-electron.git] / src / features / peers / components / ListItem.jsx
1 import React from 'react'
2 import {withNamespaces} from 'react-i18next'
3
4 class ListItem extends React.Component {
5   render() {
6     const {item, t} = this.props
7
8     return(
9       <tr>
10         <td>{item.remoteAddr || '-'}</td>
11         <td><code>{item.height}</code></td>
12         <td><code>{item.ping}</code></td>
13         <td><code>{item.duration}</code></td>
14         <td>{ item.totalSent+ item.totalReceived }</td>
15         <td>
16           <button className='btn btn-link' onClick={() => this.props.disconnect(item.peerId)}>
17             {t('peers.disconnect')}
18           </button>
19         </td>
20       </tr>
21     )
22   }
23 }
24
25 export default withNamespaces('translations') (ListItem)