From 5a4de48a6d63cb383832f6ef85b21699a511b755 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 25 May 2018 19:54:38 +0200 Subject: stubbing in a lot of stuff! --- app/client/dashboard/filelist.component.js | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 app/client/dashboard/filelist.component.js (limited to 'app/client/dashboard/filelist.component.js') diff --git a/app/client/dashboard/filelist.component.js b/app/client/dashboard/filelist.component.js new file mode 100644 index 0000000..2833ec8 --- /dev/null +++ b/app/client/dashboard/filelist.component.js @@ -0,0 +1,46 @@ +import { h, Component } from 'preact' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' +import * as util from '../util' + +class FileList extends Component { + constructor(props){ + super() + } + render(){ + const { files } = this.props + let time = 0 + const fileList = files.map(file => { + const eta = (time + (file.epochs) * 180 / 60) + " min." + time += (file.epochs) * 180 / 60 + let dataset_type, dataset_name + if (file.dataset.indexOf('/') !== -1) { + [dataset_type, dataset_name] = file.dataset.split('/') + } else { + dataset_name = file.dataset + } + return ( +
+
{file.activity} {file.library} {dataset_type}
+
{dataset_name}
+
{file.epochs} ep.
+
{eta}
+
+ ) + }) + return ( +
+ {fileList} +
+ ) + } +} + +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ + // actions: bindActionCreators(liveActions, dispatch) +}) + +export default connect(mapStateToProps, mapDispatchToProps)(FileList) -- cgit v1.2.3-70-g09d2