import { memo } from 'react'; import ReactMarkdown from 'react-markdown'; import remarkGfm from 'remark-gfm'; import { MentionUser, NoteSkeleton } from '@shared/notes'; import { User } from '@shared/user'; import { BLOCK_KINDS } from '@stores/constants'; import { useBlock } from '@utils/hooks/useBlock'; import { useEvent } from '@utils/hooks/useEvent'; export const MentionNote = memo(function MentionNote({ id }: { id: string }) { const { add } = useBlock(); const { status, data } = useEvent(id); const openThread = (event, thread: string) => { const selection = window.getSelection(); if (selection.toString().length === 0) { add.mutate({ kind: BLOCK_KINDS.thread, title: 'Thread', content: thread }); } else { event.stopPropagation(); } }; return (
Failed to fetch event
)}