import { memo, useState, } from 'react' import { useTranslation } from 'react-i18next' import { RiMoreFill } from '@remixicon/react' import cn from '@/utils/classnames' import ShortcutsName from '@/app/components/workflow/shortcuts-name' import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' import Switch from '@/app/components/base/switch' export type OperatorProps = { onCopy: () => void onDuplicate: () => void onDelete: () => void showAuthor: boolean onShowAuthorChange: (showAuthor: boolean) => void } const Operator = ({ onCopy, onDelete, onDuplicate, showAuthor, onShowAuthorChange, }: OperatorProps) => { const { t } = useTranslation() const [open, setOpen] = useState(false) return ( setOpen(!open)}>
{ onCopy() setOpen(false) }} > {t('workflow.common.copy')}
{ onDuplicate() setOpen(false) }} > {t('workflow.common.duplicate')}
e.stopPropagation()} >
{t('workflow.nodes.note.editor.showAuthor')}
{ onDelete() setOpen(false) }} > {t('common.operation.delete')}
) } export default memo(Operator)