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)