diff options
Diffstat (limited to 'app/client/common/fileList.component.js')
| -rw-r--r-- | app/client/common/fileList.component.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js new file mode 100644 index 0000000..8ee61f7 --- /dev/null +++ b/app/client/common/fileList.component.js @@ -0,0 +1,44 @@ +import { h, Component } from 'preact' +import { bindActionCreators } from 'redux' +import { connect } from 'react-redux' +import moment from 'moment' +import * as util from '../util' + +class FileList extends Component { + constructor(props){ + super() + } + render(){ + const { files } = this.props + const fileList = files.map(file => { + return ( + <div class='row' key={file.name}> + <div className="filename">{file.name || file.url}</div> + <div className="size">{file.size || ''}</div> + <div className="date">{moment(file.created_at).format("YYYY-MM-DD H:mm")}</div> + {file.epoch && <div className="epoch">epoch {file.epoch}</div>} + <div className='activity'>{file.activity || ''} {file.module || ''}</div> + {this.props.options && this.props.options(file)} + {file.epochs && <div className='epochs'>{file.epochs} ep.</div>} + {file.eta && <div className='eta'>{file.eta}</div>} + </div> + ) + }) + return ( + <div className='filelist rows'> + {fileList} + </div> + ) + } +} + + + +const mapStateToProps = state => ({ +}) + +const mapDispatchToProps = (dispatch, ownProps) => ({ + // actions: bindActionCreators(liveActions, dispatch) +}) + +export default connect(mapStateToProps, mapDispatchToProps)(FileList) |
