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-01-12 09:10:59 +01:00
|
|
|
export const ChoiceItemNodeContextMenu = ({ itemId }: { itemId: string }) => {
|
|
|
|
const { deleteChoiceItem } = useTypebot()
|
2022-01-06 09:40:56 +01:00
|
|
|
|
2022-01-12 09:10:59 +01:00
|
|
|
const handleDeleteClick = () => deleteChoiceItem(itemId)
|
2021-12-22 14:59:07 +01:00
|
|
|
|
|
|
|
return (
|
|
|
|
<MenuList>
|
|
|
|
<MenuItem icon={<TrashIcon />} onClick={handleDeleteClick}>
|
|
|
|
Delete
|
|
|
|
</MenuItem>
|
|
|
|
</MenuList>
|
|
|
|
)
|
|
|
|
}
|