flowstudio
Version:
Enterprise Flow Designer
19 lines • 1.46 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Card, Flex, Button } from "@radix-ui/themes";
import { BiMessage, BiTrash } from "react-icons/bi";
import { FaMessage } from "react-icons/fa6";
export default function ContextMenu({ showMenu, setShowMenu, menuPosition }) {
// const {showMenu, menuPosition} = useConfigStore()
const handleMenuItemClick = (action) => {
setShowMenu(false);
// Perform action based on the selected menu item
// console.log('Selected action:', action);
};
return (_jsx(Card, { onBlur: () => { setShowMenu(false); }, style: {
position: 'fixed',
top: menuPosition.y,
left: menuPosition.x,
zIndex: 1000,
}, children: _jsxs(Flex, { direction: 'column', gap: '3', children: [_jsxs(Button, { variant: 'ghost', size: '1', onClick: () => handleMenuItemClick('Action 1'), style: { justifyContent: 'start', width: '100%' }, children: [_jsx(FaMessage, {}), " Normal Node"] }), _jsxs(Button, { variant: 'ghost', size: '1', onClick: () => handleMenuItemClick('Action 1'), style: { justifyContent: 'start', width: '100%' }, children: [_jsx(BiMessage, {}), " End Node"] }), _jsxs(Button, { variant: 'ghost', size: '1', onClick: () => handleMenuItemClick('Action 1'), color: 'red', style: { justifyContent: 'start', width: '100%' }, children: [_jsx(BiTrash, {}), " Delete Node"] })] }) }));
}
//# sourceMappingURL=context.js.map