import React, { Component } from 'react'; import { connect } from 'react-redux'; import selectTorrent, { UNION, SUBTRACT, EXCLUSIVE } from '../actions/selection'; import { formatBitrate } from '../bitrate'; class TorrentTable extends Component { render() { const { selection, torrents, dispatch } = this.props; return (
name | up | down | ratio | |
---|---|---|---|---|
dispatch(selectTorrent(t.id, e.target.checked ? UNION : SUBTRACT)) } /> | { e.preventDefault(); dispatch(selectTorrent(t.id, EXCLUSIVE)); }} >{t.name} | {formatBitrate(t.rate_up)} | {formatBitrate(t.rate_down)} | {(t.transferred_up / t.transferred_down).toFixed(2)} |