import { useSecondaryPage } from '@/PageManager' import { getUsingClient } from '@/lib/event' import { toNote } from '@/lib/link' import { Event } from 'nostr-tools' import { useMemo } from 'react' import Content from '../Content' import { FormattedTimestamp } from '../FormattedTimestamp' import NoteStats from '../NoteStats' import ParentNotePreview from '../ParentNotePreview' import UserAvatar from '../UserAvatar' import Username from '../Username' export default function Note({ event, parentEvent, size = 'normal', className, hideStats = false, fetchNoteStats = false }: { event: Event parentEvent?: Event size?: 'normal' | 'small' className?: string hideStats?: boolean fetchNoteStats?: boolean }) { const { push } = useSecondaryPage() const usingClient = useMemo(() => getUsingClient(event), [event]) return (
{usingClient && size === 'normal' && (
using {usingClient}
)}
{parentEvent && ( { e.stopPropagation() push(toNote(parentEvent)) }} /> )} {!hideStats && ( )}
) }