import { contentParser } from '@lume/app/newsfeed/components/contentParser'; import { NoteDefaultUser } from '@lume/app/newsfeed/components/user/default'; import { RelayContext } from '@lume/shared/relayProvider'; import { READONLY_RELAYS } from '@lume/stores/constants'; import { memo, useContext } from 'react'; import useSWRSubscription from 'swr/subscription'; export const NoteQuote = memo(function NoteQuote({ id }: { id: string }) { const pool: any = useContext(RelayContext); const { data, error } = useSWRSubscription(id ? id : null, (key, { next }) => { const unsubscribe = pool.subscribe( [ { ids: [key], }, ], READONLY_RELAYS, (event: any) => { next(null, event); }, undefined, undefined, { unsubscribeOnEose: true, } ); return () => { unsubscribe(); }; }); return (