plane/space/components/editor/lite-text-read-only-editor.tsx

21 lines
775 B
TypeScript
Raw Normal View History

import React from "react";
import { ILiteTextReadOnlyEditor, LiteTextReadOnlyEditorWithRef } from "@plane/lite-text-editor";
2024-01-11 14:47:59 +00:00
import useEditorSuggestions from "hooks/use-editor-suggestions";
interface EditorHandle {
clearEditor: () => void;
setEditorValue: (content: string) => void;
}
interface LiteTextReadOnlyEditorWrapperProps extends Omit<ILiteTextReadOnlyEditor, "mentionHighlights"> {}
export const LiteTextReadOnlyEditor = React.forwardRef<EditorHandle, LiteTextReadOnlyEditorWrapperProps>(
({ ...props }, ref) => {
2024-01-11 14:47:59 +00:00
const mentionsConfig = useEditorSuggestions();
2024-01-11 14:47:59 +00:00
return <LiteTextReadOnlyEditorWithRef ref={ref} mentionHighlights={mentionsConfig.mentionHighlights} {...props} />;
}
);
LiteTextReadOnlyEditor.displayName = "LiteTextReadOnlyEditor";