Files
dify/web/app/components/workflow/comment-manager.tsx
2025-09-14 12:10:37 +08:00

22 lines
550 B
TypeScript

import { useEventListener } from 'ahooks'
import { useWorkflowStore } from './store'
import { useWorkflowComment } from './hooks/use-workflow-comment'
const CommentManager = () => {
const workflowStore = useWorkflowStore()
const { handleCreateComment } = useWorkflowComment()
useEventListener('click', (e) => {
const { controlMode, mousePosition } = workflowStore.getState()
if (controlMode === 'comment') {
e.preventDefault()
handleCreateComment(mousePosition)
}
})
return null
}
export default CommentManager