forked from qiime2/q2studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJobList.jsx
46 lines (41 loc) · 1.39 KB
/
JobList.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// ----------------------------------------------------------------------------
// Copyright (c) 2016-2021, QIIME 2 development team.
//
// Distributed under the terms of the Modified BSD License.
//
// The full license is in the file LICENSE, distributed with this software.
// ----------------------------------------------------------------------------
import React from 'react';
import { ipcRenderer as ipc } from 'electron';
import JobRow from './JobRow';
const JobList = ({ jobs, jobTab }) => (
<table className="table">
<thead>
<tr>
<th className="col-md-6">Action</th>
<th className="col-md-3">Started</th>
<th className="col-md-3">
{jobTab !== 'active' ? 'Finished' : 'Elapsed'}
</th>
</tr>
</thead>
<tbody>
{jobs.length ? (
jobs.map(job =>
<JobRow
data={job}
key={job.uuid}
onClick={() => ipc.send('open-new-page', {
url: `job/${job.uuid}`
})}
/>
)) : (<tr><td>{`No ${jobTab} jobs...`}</td></tr>)
}
</tbody>
</table>
);
JobList.propTypes = {
jobs: React.PropTypes.array,
jobTab: React.PropTypes.string
};
export default JobList;