17782: Fixes almost all tests (4 left) mostly by fixing namespace-type imports.
[arvados-workbench2.git] / src / components / switch-field / switch-field.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
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';
9
10 export const SwitchField = ({ switchProps, ...props }: FormFieldProps & { switchProps: SwitchProps }) =>
11     <FormField {...props}>
12         {input => <Switch {...switchProps} checked={input.value} onChange={input.onChange} />}
13     </FormField>;
14