dify/web/app/components/base/prompt-editor/plugins/test-utils.tsx
Poojan b5f62b98f9
test: add unit tests for base-components-part-5 (#32457)
Co-authored-by: sahil-infocusp <73810410+sahil-infocusp@users.noreply.github.com>
2026-02-25 22:13:10 +08:00

18 lines
451 B
TypeScript

import type { LexicalEditor } from 'lexical'
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
import { useEffect } from 'react'
type CaptureEditorPluginProps = {
onReady: (editor: LexicalEditor) => void
}
export const CaptureEditorPlugin = ({ onReady }: CaptureEditorPluginProps) => {
const [editor] = useLexicalComposerContext()
useEffect(() => {
onReady(editor)
}, [editor, onReady])
return null
}