import { Box, FormControlLabel, Checkbox, Typography } from "@mui/material"; import Modal from "../../components/Modal/Modal"; import { CheckBoxOutlineBlank, CheckBoxOutlined } from "@mui/icons-material"; const SettingsModal = ({ isOpen, close, submit, selectedValues, possibleValues, onChange }) => { const handleCheckboxChange = (type, isChecked) => { const updatedTypes = possibleValues.filter(v => { if (v === type) return isChecked return selectedValues.includes(v) }) onChange(updatedTypes); }; return ( close()} > {possibleValues.map((type, i) => { const isChecked = selectedValues.includes(type); return ( handleCheckboxChange(type, event.target.checked)} icon={} checkedIcon={} /> } label={{type} History} /> ) })} ) } export default SettingsModal;