Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

595 B
Raw Blame
import { useLexicalComposerContext } from '@lobehub/editor';
import { type FC, useLayoutEffect } from 'react';

import ReferTopic from './ReferTopic';
import { ReferTopicPlugin } from './ReferTopicPlugin';

const ReactReferTopicPlugin: FC = () => {
  const [editor] = useLexicalComposerContext();

  useLayoutEffect(() => {
    editor.registerPlugin(ReferTopicPlugin, {
      decorator: (node) => {
        return <ReferTopic node={node} />;
      },
    });
  }, [editor]);

  return null;
};

ReactReferTopicPlugin.displayName = 'ReactReferTopicPlugin';

export default ReactReferTopicPlugin;