2024-01-11 12:12:15 +00:00
|
|
|
import React from "react";
|
2024-01-11 14:31:29 +00:00
|
|
|
import { ILiteTextReadOnlyEditor, LiteTextReadOnlyEditorWithRef } from "@plane/lite-text-editor";
|
2024-01-11 12:12:15 +00:00
|
|
|
|
|
|
|
import { useMention } from "hooks/store";
|
|
|
|
|
|
|
|
interface EditorHandle {
|
|
|
|
clearEditor: () => void;
|
|
|
|
setEditorValue: (content: string) => void;
|
|
|
|
}
|
|
|
|
|
2024-01-11 14:31:29 +00:00
|
|
|
interface LiteTextReadOnlyEditorWrapperProps extends Omit<ILiteTextReadOnlyEditor, "mentionHighlights"> {}
|
2024-01-11 12:12:15 +00:00
|
|
|
|
|
|
|
export const LiteTextReadOnlyEditor = React.forwardRef<EditorHandle, LiteTextReadOnlyEditorWrapperProps>(
|
|
|
|
({ ...props }, ref) => {
|
|
|
|
const editorSuggestions = useMention();
|
|
|
|
|
2024-01-11 13:17:51 +00:00
|
|
|
return (
|
|
|
|
<LiteTextReadOnlyEditorWithRef ref={ref} mentionHighlights={editorSuggestions.mentionHighlights} {...props} />
|
|
|
|
);
|
2024-01-11 12:12:15 +00:00
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
LiteTextReadOnlyEditor.displayName = "LiteTextReadOnlyEditor";
|