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';
16 import { FilterOption } from './process-log-panel';
18 type CssRules = 'formControl';
20 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
22 minWidth: theme.spacing.unit * 15,
26 export interface ProcessLogFormDataProps {
27 selectedFilter: FilterOption;
28 filters: FilterOption[];
31 export interface ProcessLogFormActionProps {
32 onChange: (filter: FilterOption) => void;
35 type ProcessLogFormProps = ProcessLogFormDataProps & ProcessLogFormActionProps & WithStyles<CssRules>;
37 export const ProcessLogForm = withStyles(styles)(
38 ({ classes, selectedFilter, onChange, filters }: ProcessLogFormProps) =>
39 <form autoComplete="off">
40 <FormControl className={classes.formControl}>
42 value={selectedFilter.value}
43 onChange={({ target }) => onChange({ label: target.innerText, value: target.value })}
44 input={<Input name="eventType" id="log-label-placeholder" />}
48 <MenuItem key={option.value} value={option.value}>{option.label}</MenuItem>