summaryrefslogtreecommitdiff
path: root/app/client/dashboard/dashboardHeader.component.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/client/dashboard/dashboardHeader.component.js')
-rw-r--r--app/client/dashboard/dashboardHeader.component.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/app/client/dashboard/dashboardHeader.component.js b/app/client/dashboard/dashboardHeader.component.js
new file mode 100644
index 0000000..492dfd8
--- /dev/null
+++ b/app/client/dashboard/dashboardHeader.component.js
@@ -0,0 +1,39 @@
+import { h, Component } from 'preact'
+import { connect } from 'react-redux'
+import { bindActionCreators } from 'redux'
+import * as liveActions from '../live/actions'
+
+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 (
+ <div class='dashboardHeader heading'>
+ <h3>{site.name}</h3>
+ Currently {util.gerund(currentTask.activity)} {currentTask.library} on {currentTask.dataset}<br/>
+ Epoch: {currentTask.epoch} / {currentTask.epochs}, ETA {eta}<br/>
+ <br/>
+ Want to play live? <button>Pause at the end of this epoch</button>
+ </div>
+ )
+ }
+}
+
+const mapStateToProps = state => ({
+ currentTask: state.system.currentTask,
+ site: state.system.site,
+})
+
+const mapDispatchToProps = (dispatch, ownProps) => ({
+})
+
+export default connect(mapStateToProps, mapDispatchToProps)(DashboardHeader)