diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-02 13:02:47 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-02 13:02:47 +0200 |
| commit | a6a529a5757417906f6df60ca7557fac3a380966 (patch) | |
| tree | 2791fccff9c24035da59106fb7bfcdefd444186a /app/client/common | |
| parent | 4d6835094db8d3171d2ba42967a1dff9e622055a (diff) | |
work out data relationships for samplernn
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> ) } |
