import { h, Component } from 'preact' import { bindActionCreators } from 'redux' import { connect } from 'react-redux' import { Link } from 'react-router-dom'; import moment from 'moment' import * as util from '../util' const defaultFields = new Set(['date', 'size']) class FileList extends Component { constructor(props){ super() } render(){ const { files, linkFiles, onClick } = this.props if (!files.length) return null let fields = this.props.fields || defaultFields const fileList = files.map(file => { const size = util.hush_size(file.size) const date = file.created_at const username = file.username || "" return (