2
0
Files
bot/apps/builder/components/shared/Graph/Nodes/GroupNode/GroupNodeContextMenu.tsx

27 lines
692 B
TypeScript
Raw Normal View History

import { MenuList, MenuItem } from '@chakra-ui/react'
import { CopyIcon, TrashIcon } from 'assets/icons'
2022-01-06 09:40:56 +01:00
import { useTypebot } from 'contexts/TypebotContext/TypebotContext'
2022-06-11 07:27:38 +02:00
export const GroupNodeContextMenu = ({
groupIndex,
}: {
groupIndex: number
}) => {
const { deleteGroup, duplicateGroup } = useTypebot()
2022-06-11 07:27:38 +02:00
const handleDeleteClick = () => deleteGroup(groupIndex)
2022-01-06 09:40:56 +01:00
2022-06-11 07:27:38 +02:00
const handleDuplicateClick = () => duplicateGroup(groupIndex)
return (
<MenuList>
<MenuItem icon={<CopyIcon />} onClick={handleDuplicateClick}>
Duplicate
</MenuItem>
<MenuItem icon={<TrashIcon />} onClick={handleDeleteClick}>
Delete
</MenuItem>
</MenuList>
)
}