import React, { createContext, useState, FC, ReactNode, } from "react"; interface EditorContextType { selectedElement: string | null; setSelectedElement: (id: string | null) => void; scale: number; setScale: (scale: number) => void; showGrid: boolean; setShowGrid: (show: boolean) => void; snapToGrid: boolean; setSnapToGrid: (snap: boolean) => void; } const EditorContext = createContext(undefined); export const EditorProvider: FC<{ children: ReactNode }> = ({ children }) => { const [selectedElement, setSelectedElement] = useState(null); const [scale, setScale] = useState(100); const [showGrid, setShowGrid] = useState(false); const [snapToGrid, setSnapToGrid] = useState(true); return ( {children} ); };