import { useState } from 'react' import PropTypes from 'prop-types' import { FormControl, Switch } from '@mui/material' export const SwitchInput = ({ value, onChange, disabled = false }) => { const [myValue, setMyValue] = useState(!!value ?? false) return ( <> { setMyValue(event.target.checked) onChange(event.target.checked) }} /> ) } SwitchInput.propTypes = { value: PropTypes.string, onChange: PropTypes.func, disabled: PropTypes.bool }