1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { ArvadosTheme } from '~/common/custom-theme';
7 import { StyleRulesCallback, withStyles, WithStyles, Card, CardHeader, CardContent, Grid, Typography } from '@material-ui/core';
8 import { SubprocessFilter } from '~/components/subprocess-filter/subprocess-filter';
9 import { SubprocessFilterDataProps } from '~/components/subprocess-filter/subprocess-filter';
11 type CssRules = 'root' | 'title' | 'gridFilter';
13 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
19 color: theme.palette.grey["700"]
23 marginBottom: theme.spacing.unit,
24 paddingTop: '0px!important',
25 paddingBottom: '0px!important',
29 interface SubprocessesDataProps {
30 subprocessesAmount: number;
31 filters: SubprocessFilterDataProps[];
32 onToggle: (status: string) => void;
35 type SubprocessesProps = SubprocessesDataProps & WithStyles<CssRules>;
37 export const SubprocessesCard = withStyles(styles)(
38 ({ classes, filters, subprocessesAmount, onToggle }: SubprocessesProps) =>
39 <Card className={classes.root}>
41 className={classes.title}
43 <Typography noWrap variant='h6' color='inherit'>
44 Subprocess and filters
47 <Grid container direction="column" spacing={16}>
48 <Grid item xs={12} container spacing={16}>
49 <Grid item md={12} lg={6}>
50 <SubprocessFilter label='Subprocesses' value={subprocessesAmount} />
52 <Grid item md={12} lg={6}/>
55 <Grid item md={12} lg={6} key={filter.key} className={classes.gridFilter}>
56 <SubprocessFilter {...filter} onToggle={() => onToggle(filter.label)} />