import { Box, Flex, Switch, SwitchProps } from '@chakra-ui/react'; import { css } from '@emotion/react'; import { useField, useFormikContext } from 'formik'; import React, { FC } from 'react'; import { BaseProps, FormControl } from '../form-control'; export type SwitchControlProps = BaseProps & { switchProps?: SwitchProps }; export const SwitchControl: FC = React.forwardRef( (props: SwitchControlProps, ref: React.ForwardedRef) => { const { name, label, switchProps, ...rest } = props; const [field, { error, touched }] = useField(name); const { isSubmitting } = useFormikContext(); return ( ); } ); export default SwitchControl;