From a6a529a5757417906f6df60ca7557fac3a380966 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 2 Jun 2018 13:02:47 +0200 Subject: work out data relationships for samplernn --- app/client/common/fileList.component.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'app/client/common/fileList.component.js') 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 ( -
- {title &&

{title}

} - {fileList} +
+
+ {files.length ? +

{title || Files}

: +

No files

} +
{(loading || error) && status}
+
+ +
+ {fileList} +
) } -- cgit v1.2.3-70-g09d2