forked from TamimEhsan/AlgorithmVisualizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformControlLabel.jsx
More file actions
26 lines (22 loc) · 779 Bytes
/
Copy pathformControlLabel.jsx
File metadata and controls
26 lines (22 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import React from 'react';
import FormGroup from '@material-ui/core/FormGroup';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import Switch from '@material-ui/core/Switch';
export default function SwitchLabels(props) {
const [state, setState] = React.useState({
checkedA: false,
});
const handleChange = (event) => {
setState({ ...state, [event.target.name]: event.target.checked });
props.onDoubleChange(event.target.checked);
};
return (
<FormGroup row>
<FormControlLabel
control={<Switch checked={state.checkedA} onChange={handleChange} name="checkedA" />}
label="Duo"
disabled={props.disable}
/>
</FormGroup>
);
}