import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk'; import { nip19 } from 'nostr-tools'; import { ArticleNote, FileNote, LinkPreview, NoteActions, NoteSkeleton, TextNote, UnknownNote, } from '@shared/notes'; import { User } from '@shared/user'; import { useEvent } from '@utils/hooks/useEvent'; export function ChildNote({ id, root }: { id: string; root?: string }) { const { status, data } = useEvent(id); const renderKind = (event: NDKEvent) => { switch (event.kind) { case NDKKind.Text: return ; case NDKKind.Article: return ; case 1063: return ; default: return ; } }; if (status === 'pending') { return ( <>
); } if (status === 'error') { const noteLink = `https://njump.me/${nip19.noteEncode(id)}`; return ( <>
Lume (System)
Lume cannot find this post with your current relay set, but you can view it via njump.me
); } return ( <>
{renderKind(data)}
); }