import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk'; import { memo } from 'react'; import { useStorage } from '@libs/storage/provider'; import { ArticleNote, FileNote, NoteSkeleton, TextNote, UnknownNote, } from '@shared/notes'; import { User } from '@shared/user'; import { WidgetKinds, useWidgets } from '@stores/widgets'; import { useEvent } from '@utils/hooks/useEvent'; export const MentionNote = memo(function MentionNote({ id }: { id: string }) { const { db } = useStorage(); const { status, data } = useEvent(id); const setWidget = useWidgets((state) => state.setWidget); const openThread = (event, thread: string) => { const selection = window.getSelection(); if (selection.toString().length === 0) { setWidget(db, { kind: WidgetKinds.thread, title: 'Thread', content: thread }); } else { event.stopPropagation(); } }; if (status === 'loading') { return (
Can't get event from relay