Create OtomatikSwitch component
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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 (
|
||||
<FormGroup sx={{marginTop: 2}}>
|
||||
<FormControlLabel control={<Switch checked={tradiksyonOtomatik} onChange={handleChange} />} disabled={disabled} label='Traduction automatique du Français vers les autres langues' labelPlacement='top' />
|
||||
</FormGroup>
|
||||
)
|
||||
}
|
||||
|
||||
OtomatikSwitch.propTypes = {
|
||||
tradiksyonOtomatik: PropTypes.bool.isRequired,
|
||||
setTradiksyonOtomatik: PropTypes.func.isRequired,
|
||||
disabled: PropTypes.bool.isRequired
|
||||
}
|
||||
Reference in New Issue
Block a user