1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
7 import { ArvadosTheme } from '~/common/custom-theme';
8 import { Grid, Typography, Switch } from '@material-ui/core';
10 type CssRules = 'grid' | 'label' | 'value' | 'switch';
12 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
16 paddingTop: '0px!important',
17 paddingBottom: '0px!important',
18 marginBottom: theme.spacing.unit
22 color: theme.palette.grey["500"],
27 paddingLeft: theme.spacing.unit,
31 '& span:first-child': {
37 export interface SubprocessFilterDataProps {
42 onToggle?: () => void;
45 type SubprocessFilterProps = SubprocessFilterDataProps & WithStyles<CssRules>;
47 export const SubprocessFilter = withStyles(styles)(
48 ({ classes, label, value, key, checked, onToggle }: SubprocessFilterProps) =>
49 <Grid item className={classes.grid} md={12} lg={6} >
50 <Typography component="span" className={classes.label}>{label}:</Typography>
51 <Typography component="span" className={classes.value}>{value}</Typography>
52 {onToggle && <Switch classes={{ root: classes.switch }}