import { useContext } from "react";
import { ContextMenuContext } from "./ContextMenuProvider";

export function useContextMenu() {
    const context = useContext(ContextMenuContext);
    if (!context) {
        throw new Error('useContextMenu must be used within a ContextMenuProvider');
    }
    return context.openContextMenu;
}