<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Integrated localization support across various components using the `useTranslate` hook for dynamic translations. - **Enhancements** - Replaced hardcoded text with localized strings to support multiple languages in the user interface. - **User Interface** - Updated labels, placeholders, tooltips, and button texts to utilize translated content for a multilingual experience. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Baptiste Arnaud <baptiste.arnaud95@gmail.com>
29 lines
793 B
TypeScript
29 lines
793 B
TypeScript
import { MenuList, MenuItem } from '@chakra-ui/react'
|
|
import { CopyIcon, TrashIcon } from '@/components/icons'
|
|
import { useTypebot } from '@/features/editor/providers/TypebotProvider'
|
|
import { useTranslate } from '@tolgee/react'
|
|
|
|
export const GroupNodeContextMenu = ({
|
|
groupIndex,
|
|
}: {
|
|
groupIndex: number
|
|
}) => {
|
|
const { t } = useTranslate()
|
|
const { deleteGroup, duplicateGroup } = useTypebot()
|
|
|
|
const handleDeleteClick = () => deleteGroup(groupIndex)
|
|
|
|
const handleDuplicateClick = () => duplicateGroup(groupIndex)
|
|
|
|
return (
|
|
<MenuList>
|
|
<MenuItem icon={<CopyIcon />} onClick={handleDuplicateClick}>
|
|
{t('duplicate')}
|
|
</MenuItem>
|
|
<MenuItem icon={<TrashIcon />} onClick={handleDeleteClick}>
|
|
{t('delete')}
|
|
</MenuItem>
|
|
</MenuList>
|
|
)
|
|
}
|