1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { FormFieldProps, FormField } from 'components/form-field/form-field';
7 import { Switch } from '@material-ui/core';
8 import { SwitchProps } from '@material-ui/core/Switch';
10 export const SwitchField = ({ switchProps, ...props }: FormFieldProps & { switchProps: SwitchProps }) =>
11 <FormField {...props}>
12 {input => <Switch {...switchProps} checked={input.value} onChange={input.onChange} />}