import { h, Component } from 'preact' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import * as util from '../util' class DashboardHeader extends Component { constructor(props){ super(props) this.handleClick = this.handleClick.bind(this) } handleClick(e){ this.props.onClick && this.props.onClick() } render() { const { currentTask, site } = this.props const eta = ((currentTask.epochs - currentTask.epoch) * 180 / 60) + " minutes" return (

{site.name}

Currently {util.gerund(currentTask.activity)} {currentTask.module} on {currentTask.dataset}
Epoch: {currentTask.epoch} / {currentTask.epochs}, ETA {eta}

Want to play live?
) } } const mapStateToProps = state => ({ currentTask: state.task.currentTask, site: state.system.site, }) const mapDispatchToProps = (dispatch, ownProps) => ({ }) export default connect(mapStateToProps, mapDispatchToProps)(DashboardHeader)