Files
pawol.nu/components/soumet/otomatik-switch.js
T

27 lines
878 B
JavaScript
Raw Normal View History

2022-03-27 02:16:32 +04:00
import PropTypes from 'prop-types'
import FormGroup from '@mui/material/FormGroup'
import FormControlLabel from '@mui/material/FormControlLabel'
import Switch from '@mui/material/Switch'
export default function OtomatikSwitch({tradiksyonOtomatik, setTradiksyonOtomatik, disabled}) {
const handleChange = event => {
setTradiksyonOtomatik(event.target.checked)
}
return (
2022-03-27 05:08:42 +04:00
<FormGroup sx={{marginTop: 1}}>
2022-05-20 02:21:01 +04:00
<FormControlLabel
control={<Switch checked={tradiksyonOtomatik && !disabled} onChange={handleChange} />}
disabled={disabled}
label='Traduction du français vers les autres langues (remplir uniquement la traduction française)'
/>
2022-03-27 02:16:32 +04:00
</FormGroup>
)
}
OtomatikSwitch.propTypes = {
tradiksyonOtomatik: PropTypes.bool.isRequired,
setTradiksyonOtomatik: PropTypes.func.isRequired,
disabled: PropTypes.bool.isRequired
}