2021-12-22 14:59:07 +01:00
|
|
|
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'
|
2021-12-22 14:59:07 +01:00
|
|
|
|
2022-02-04 19:00:08 +01:00
|
|
|
export const BlockNodeContextMenu = ({
|
|
|
|
blockIndex,
|
|
|
|
}: {
|
|
|
|
blockIndex: number
|
|
|
|
}) => {
|
2022-01-06 09:40:56 +01:00
|
|
|
const { deleteBlock } = useTypebot()
|
|
|
|
|
2022-02-04 19:00:08 +01:00
|
|
|
const handleDeleteClick = () => deleteBlock(blockIndex)
|
2021-12-22 14:59:07 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<MenuList>
|
|
|
|
<MenuItem icon={<TrashIcon />} onClick={handleDeleteClick}>
|
|
|
|
Delete
|
|
|
|
</MenuItem>
|
|
|
|
</MenuList>
|
|
|
|
)
|
|
|
|
}
|