1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { EnumCommandInputParameter, CommandInputEnumSchema } from '~/models/workflow';
7 import { Field } from 'redux-form';
8 import { Select, MenuItem } from '@material-ui/core';
9 import { GenericInputProps, GenericInput } from './generic-input';
11 export interface EnumInputProps {
12 input: EnumCommandInputParameter;
14 export const EnumInput = ({ input }: EnumInputProps) =>
18 component={EnumInputComponent}
21 const EnumInputComponent = (props: GenericInputProps) =>
26 const Input = (props: GenericInputProps) => {
27 const type = props.commandInput.type as CommandInputEnumSchema;
29 value={props.input.value}
30 onChange={props.input.onChange}>
31 {type.symbols.map(symbol =>
32 <MenuItem key={symbol} value={symbol.split('/').pop()}>
33 {symbol.split('/').pop()}