import React, {useState} from 'react'; import FormControlLabel from '@mui/material/FormControlLabel'; import Checkbox from '@mui/material/Checkbox'; import {SketchPicker} from 'react-color'; import {Accordion, AccordionSummary, AccordionDetails} from '@mui/material'; import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import Box from '@mui/material/Box'; function CanvasSettingsPanel({setCanvasBgColor, setCanvasGround, setCanvasGrid, setCanvasAxis}) { const [bgColorChecked, setBgColorChecked] = useState(false); const [bgColor, setBgColor] = useState(); const [groundChecked, setGroundChecked] = useState(true); const [axisChecked, setAxisChecked] = useState(true); const [gridChecked, setGridChecked] = useState(true); return (
}> Canvas { setBgColorChecked(event.target.checked); }} color="primary" /> } label={'Background Color'} /> {bgColorChecked && ( { setBgColor(color); setCanvasBgColor(color); }} disableAlpha={true} /> )} { setGroundChecked(event.target.checked); if (setCanvasGround) { setCanvasGround(event.target.checked); } }} color="primary" /> } label='Ground' /> { setGridChecked(event.target.checked); setCanvasGrid(event.target.checked) }} color="primary" /> } label='Grid' /> { setAxisChecked(event.target.checked); setCanvasAxis(event.target.checked) }} color="primary" /> } label='Axis' />
); } export default CanvasSettingsPanel;