1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { withStyles, WithStyles, StyleRulesCallback, FormControl, InputLabel, Select, MenuItem, Input } from '@material-ui/core';
7 import { ArvadosTheme } from '~/common/custom-theme';
8 import { FilterOption } from './process-log-panel';
10 type CssRules = 'formControl';
12 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
18 export interface ProcessLogFormDataProps {
19 selectedFilter: FilterOption;
20 filters: FilterOption[];
23 export interface ProcessLogFormActionProps {
24 onChange: (filter: FilterOption) => void;
27 type ProcessLogFormProps = ProcessLogFormDataProps & ProcessLogFormActionProps & WithStyles<CssRules>;
29 export const ProcessLogForm = withStyles(styles)(
30 ({ classes, selectedFilter, onChange, filters }: ProcessLogFormProps) =>
31 <form autoComplete="off">
32 <FormControl className={classes.formControl}>
33 <InputLabel shrink htmlFor="log-label-placeholder">
37 value={selectedFilter.value}
38 onChange={({ target }) => onChange({ label: target.innerText, value: target.value })}
39 input={<Input name="eventType" id="log-label-placeholder" />}
43 <MenuItem key={option.value} value={option.value}>{option.label}</MenuItem>