1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { BooleanCommandInputParameter } from '~/models/workflow';
7 import { Field } from 'redux-form';
8 import { Switch } from '@material-ui/core';
9 import { GenericInputProps, GenericInput } from './generic-input';
11 export interface BooleanInputProps {
12 input: BooleanCommandInputParameter;
14 export const BooleanInput = ({ input }: BooleanInputProps) =>
18 component={BooleanInputComponent}
19 normalize={(value, prevValue) => !prevValue}
22 const BooleanInputComponent = (props: GenericInputProps) =>
27 const Input = (props: GenericInputProps) =>
30 checked={props.input.value}
31 onChange={() => props.input.onChange(props.input.value)}
32 disabled={props.commandInput.disabled} />;