diff options
Diffstat (limited to 'app/client/common')
| -rw-r--r-- | app/client/common/fileList.component.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/app/client/common/fileList.component.js b/app/client/common/fileList.component.js index 8f7ff5a..ece77ae 100644 --- a/app/client/common/fileList.component.js +++ b/app/client/common/fileList.component.js @@ -11,9 +11,14 @@ class FileList extends Component { super() } render(){ - const { files, linkFiles, title, onClick } = this.props + const { files, linkFiles, title, onClick, className="" } = this.props if (!files.length) return null let fields = this.props.fields || defaultFields + if (typeof fields === 'string') { + fields = new Set(fields.split(' ')) + } else if (!(fields instanceof Set)) { + fields = new Set(fields) + } const fileList = files.map(file => { const size = util.hush_size(file.size) const date = file.created_at @@ -55,9 +60,17 @@ class FileList extends Component { ) }) return ( - <div className='filelist rows'> - {title && <h3>{title}</h3>} - {fileList} + <div className={'rows ' + className}> + <div class='row heading'> + {files.length ? + <h3>{title || Files}</h3> : + <h4>No files</h4>} + <div>{(loading || error) && status}</div> + </div> + + <div className={'filelist rows'}> + {fileList} + </div> </div> ) } |
