import React from 'react'; import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemIcon from '@material-ui/core/ListItemIcon'; import ListItemSecondaryAction from '@material-ui/core/ListItemSecondaryAction'; import ListItemText from '@material-ui/core/ListItemText'; import Checkbox from '@material-ui/core/Checkbox'; import IconButton from '@material-ui/core/IconButton'; import CommentIcon from '@material-ui/icons/Comment'; const useStyles = makeStyles((theme: Theme) => createStyles({ root: { width: '100%', maxWidth: 360, backgroundColor: theme.palette.background.paper, }, }), ); export default function CheckboxList() { const classes = useStyles(); const [checked, setChecked] = React.useState([0]); const handleToggle = (value: number) => () => { const currentIndex = checked.indexOf(value); const newChecked = [...checked]; if (currentIndex === -1) { newChecked.push(value); } else { newChecked.splice(currentIndex, 1); } setChecked(newChecked); }; return ( {[0, 1, 2, 3].map((value) => { const labelId = `checkbox-list-label-${value}`; return ( ); })} ); }