1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
14 } from '@material-ui/core';
15 import { ArvadosTheme } from 'common/custom-theme';
17 type CssRules = 'formControl';
19 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
21 minWidth: theme.spacing.unit * 15,
25 export interface FilterOption {
30 export interface ProcessLogFormDataProps {
31 selectedFilter: FilterOption;
32 filters: FilterOption[];
35 export interface ProcessLogFormActionProps {
36 onChange: (filter: FilterOption) => void;
39 type ProcessLogFormProps = ProcessLogFormDataProps & ProcessLogFormActionProps & WithStyles<CssRules>;
41 export const ProcessLogForm = withStyles(styles)(
42 ({ classes, selectedFilter, onChange, filters }: ProcessLogFormProps) =>
43 <form autoComplete="off" data-cy="process-logs-filter">
44 <FormControl className={classes.formControl}>
46 value={selectedFilter.value}
47 onChange={({ target }) => onChange({ label: target.innerText, value: target.value })}
48 input={<Input name="eventType" id="log-label-placeholder" />}
52 <MenuItem key={option.value} value={option.value}>{option.label}</MenuItem>