mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
24 lines
763 B
TypeScript
24 lines
763 B
TypeScript
import React from "react";
|
|
import { ILiteTextReadOnlyEditor, LiteTextReadOnlyEditorWithRef } from "@plane/lite-text-editor";
|
|
|
|
import { useMention } from "hooks/store";
|
|
|
|
interface EditorHandle {
|
|
clearEditor: () => void;
|
|
setEditorValue: (content: string) => void;
|
|
}
|
|
|
|
interface LiteTextReadOnlyEditorWrapperProps extends Omit<ILiteTextReadOnlyEditor, "mentionHighlights"> {}
|
|
|
|
export const LiteTextReadOnlyEditor = React.forwardRef<EditorHandle, LiteTextReadOnlyEditorWrapperProps>(
|
|
({ ...props }, ref) => {
|
|
const editorSuggestions = useMention();
|
|
|
|
return (
|
|
<LiteTextReadOnlyEditorWithRef ref={ref} mentionHighlights={editorSuggestions.mentionHighlights} {...props} />
|
|
);
|
|
}
|
|
);
|
|
|
|
LiteTextReadOnlyEditor.displayName = "LiteTextReadOnlyEditor";
|