import { useContext } from "react"; import CanvasContext from "../Context/canvasContext/CanvasContext"; import TextPanel from "./TextPanel"; import ColorPanel from "./ColorPanel"; import ShapePanel from "./ShapePanel"; import IconPanel from "./IconPanel"; import UploadPanel from "./UploadPanel"; import StrokePanel from "./StrokePanel"; import ShadowPanel from "./ShadowPanel"; import FlipPanel from "./FlipPanel"; import PositionPanel from "./PositionPanel"; import ImagePanel from "./ImagePanel"; import GroupObjectPanel from "./GroupObjectPanel"; import CanvasPanel from "./CanvasPanel"; const EditorPanel = () => { const { selectedPanel } = useContext(CanvasContext); const renderPanel = () => { switch (selectedPanel) { case "text": return ; case "shape": return ; case "icon": return ; case "upload": return ; case "color": return ; case "stroke": return ; case "shadow": return ; case "flip": return ; case "position": return ; case "image-insert": return ; case "group-obj": return ; case "canvas": return ; default: return; } }; return ( <> {selectedPanel !== "" && (
{renderPanel()}
)} ); }; export default EditorPanel;