1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { CustomStyleRulesCallback } from 'common/custom-theme';
14 } from '@material-ui/core';
15 import { ArvadosTheme } from 'common/custom-theme';
17 type CssRules = 'formControl';
19 const styles: CustomStyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
21 minWidth: theme.spacing(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>