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 { Typography, Switch } from '@material-ui/core';
10 type CssRules = 'container' | 'label' | 'value' | 'switch';
12 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
18 color: theme.palette.grey["500"],
23 paddingLeft: theme.spacing.unit,
27 '& span:first-child': {
33 export interface SubprocessFilterDataProps {
38 onToggle?: () => void;
41 type SubprocessFilterProps = SubprocessFilterDataProps & WithStyles<CssRules>;
43 export const SubprocessFilter = withStyles(styles)(
44 ({ classes, label, value, key, checked, onToggle }: SubprocessFilterProps) =>
45 <div className={classes.container} >
46 <Typography component="span" className={classes.label}>{label}:</Typography>
47 <Typography component="span" className={classes.value}>{value}</Typography>
48 {onToggle && <Switch classes={{ root: classes.switch }}