import { NDKEvent, NDKKind } from '@nostr-dev-kit/ndk';
import { memo } from 'react';
import { ReplyIcon, RepostIcon } from '@shared/icons';
import { ChildNote, TextKind } from '@shared/notes';
import { User } from '@shared/user';
import { WIDGET_KIND } from '@utils/constants';
import { formatCreatedAt } from '@utils/createdAt';
import { useNostr } from '@utils/hooks/useNostr';
import { useWidget } from '@utils/hooks/useWidget';
export function NotifyNote({ event }: { event: NDKEvent }) {
const { getEventThread } = useNostr();
const { addWidget } = useWidget();
const thread = getEventThread(event.tags);
const createdAt = formatCreatedAt(event.created_at, false);
if (event.kind === NDKKind.Reaction) {
return (
{event.content === '+' ? '👍' : event.content}
{thread.rootEventId ? : null}
);
}
if (event.kind === NDKKind.Repost) {
return (
{thread.rootEventId ? : null}
);
}
if (event.kind === NDKKind.Text) {
return (
{thread?.replyEventId ? (
) : thread?.rootEventId ? (
) : null}
);
}
}
export const MemoizedNotifyNote = memo(NotifyNote);