refs # Merge branch 'origin/upgrade-packages-ts-3.1'
[arvados-workbench2.git] / src / views / process-panel / process-subprocesses.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import { Grid } from '@material-ui/core';
7 import { ProcessSubprocessesCard } from '~/views/process-panel/process-subprocesses-card';
8 import { Process } from '~/store/processes/process';
9
10 export interface ProcessSubprocessesDataProps {
11     subprocesses: Array<Process>;
12     onContextMenu: (event: React.MouseEvent<HTMLElement>, process: Process) => void;
13 }
14
15 export const ProcessSubprocesses = ({ onContextMenu, subprocesses }: ProcessSubprocessesDataProps) => {
16     return <Grid container spacing={16}>
17         {subprocesses.map(subprocess =>
18             <Grid item xs={12} sm={6} md={4} lg={2} key={subprocess.containerRequest.uuid}>
19                 <ProcessSubprocessesCard
20                     onContextMenu={event => onContextMenu(event, subprocess)}
21                     subprocess={subprocess} />
22             </Grid>
23         )}
24     </Grid>;
25 };