1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

add option for no file selected

This commit is contained in:
Sonja Happ 2020-05-29 13:26:43 +02:00
parent 86288b39bf
commit 86af9c8f7f

View file

@ -69,11 +69,15 @@ class SelectFile extends React.Component {
render() {
let fileOptions;
let fileOptions = [];
if (this.props.files.length > 0){
fileOptions = this.props.files.map(f =>
fileOptions.push(
<option key = {0} value={-1}>Select file</option>
)
fileOptions.push(this.props.files.map(f =>
<option key={f.id} value={f.id}>{f.name}</option>
);
));
} else {
fileOptions = <option >No files available</option>
}