fix: highlight current user on read only lite text editor (#5472)

This commit is contained in:
Aaryan Khandelwal
2024-09-02 13:58:55 +05:30
committed by GitHub
parent bcd08b3159
commit 03c28a11e8

View File

@@ -4,13 +4,17 @@ import { EditorReadOnlyRefApi, ILiteTextReadOnlyEditor, LiteTextReadOnlyEditorWi
// helpers
import { cn } from "@/helpers/common.helper";
// hooks
import { useMention } from "@/hooks/store";
import { useMention, useUser } from "@/hooks/store";
interface LiteTextReadOnlyEditorWrapperProps extends Omit<ILiteTextReadOnlyEditor, "mentionHandler"> {}
export const LiteTextReadOnlyEditor = React.forwardRef<EditorReadOnlyRefApi, LiteTextReadOnlyEditorWrapperProps>(
({ ...props }, ref) => {
const { mentionHighlights } = useMention({});
// store hooks
const { data: currentUser } = useUser();
const { mentionHighlights } = useMention({
user: currentUser,
});
return (
<LiteTextReadOnlyEditorWithRef