From bcb44d5a7c4b17afd7ba64be5b497d74afc69fb6 Mon Sep 17 00:00:00 2001 From: blackhao <13851610112@163.com> Date: Fri, 5 Dec 2025 21:02:12 -0600 Subject: right click logic --- frontend/src/components/ContextMenu.tsx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 frontend/src/components/ContextMenu.tsx (limited to 'frontend/src/components') diff --git a/frontend/src/components/ContextMenu.tsx b/frontend/src/components/ContextMenu.tsx new file mode 100644 index 0000000..459641b --- /dev/null +++ b/frontend/src/components/ContextMenu.tsx @@ -0,0 +1,32 @@ +import React from 'react'; + +interface ContextMenuProps { + x: number; + y: number; + items: { label: string; onClick: () => void; danger?: boolean }[]; + onClose: () => void; +} + +export const ContextMenu: React.FC = ({ x, y, items, onClose }) => { + return ( +
e.stopPropagation()} // Prevent click through + > + {items.map((item, idx) => ( + + ))} +
+ ); +}; + -- cgit v1.2.3