2
0
Files
bot/apps/builder/components/shared/Graph/Nodes/BlockNode/BlockNodeContextMenu.tsx

18 lines
483 B
TypeScript
Raw Normal View History

import { MenuList, MenuItem } from '@chakra-ui/react'
import { TrashIcon } from 'assets/icons'
2022-01-06 09:40:56 +01:00
import { useTypebot } from 'contexts/TypebotContext/TypebotContext'
export const BlockNodeContextMenu = ({ blockId }: { blockId: string }) => {
2022-01-06 09:40:56 +01:00
const { deleteBlock } = useTypebot()
const handleDeleteClick = () => deleteBlock(blockId)
return (
<MenuList>
<MenuItem icon={<TrashIcon />} onClick={handleDeleteClick}>
Delete
</MenuItem>
</MenuList>
)
}