import { FormControl, FormControlProps, FormLabel, FormLabelProps, Switch, SwitchProps, } from '@chakra-ui/react'; import { memo } from 'react'; interface Props extends SwitchProps { label?: string; width?: string | number; formControlProps?: FormControlProps; formLabelProps?: FormLabelProps; } /** * Customized Chakra FormControl + Switch multi-part component. */ const IAISwitch = (props: Props) => { const { label, isDisabled = false, width = 'auto', formControlProps, formLabelProps, ...rest } = props; return ( {label && ( {label} )} ); }; export default memo(IAISwitch);