RunProcessInputsForm [WIP]
[arvados-workbench2.git] / src / views / run-process-panel / inputs / string-input.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import { getInputLabel, isRequiredInput, StringCommandInputParameter } from '~/models/workflow';
7 import { Field } from 'redux-form';
8 import { TextField } from '~/components/text-field/text-field';
9 import { require } from '~/validators/require';
10
11 export interface StringInputProps {
12     input: StringCommandInputParameter;
13 }
14 export const StringInput = ({ input }: StringInputProps) =>
15     <Field
16         name={input.id}
17         label={getInputLabel(input)}
18         component={TextField}
19         validate={[
20             isRequiredInput(input)
21                 ? require
22                 : () => undefined,
23         ]} />;
24