mirror of
https://github.com/langgenius/dify.git
synced 2026-04-20 10:47:21 +08:00
22 lines
550 B
TypeScript
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
|