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:
parent
86288b39bf
commit
86af9c8f7f
1 changed files with 7 additions and 3 deletions
|
@ -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>
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue