import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk'; import { useCallback } from 'react'; import { useStorage } from '@libs/storage/provider'; import { ArticleNote, FileNote, NoteActions, NoteReplyForm, NoteStats, TextNote, UnknownNote, } from '@shared/notes'; import { RepliesList } from '@shared/notes/replies/list'; import { NoteSkeleton } from '@shared/notes/skeleton'; import { TitleBar } from '@shared/titleBar'; import { User } from '@shared/user'; import { useEvent } from '@utils/hooks/useEvent'; import { Widget } from '@utils/types'; export function LocalThreadWidget({ params }: { params: Widget }) { const { db } = useStorage(); const { status, data } = useEvent(params.content); const renderKind = useCallback( (event: NDKEvent) => { switch (event.kind) { case NDKKind.Text: return ; case NDKKind.Article: return ; case 1063: return ; default: return ; } }, [data] ); return (
{status === 'loading' ? (
) : (
{renderKind(data)}
)}
); }