import "./event.css"; import { EventKind, type NostrEvent as NostrEventType, type NostrLink } from "@snort/system"; import { Icon } from "./icon"; import { Goal } from "./goal"; import { Note } from "./note"; import { EmojiPack } from "./emoji-pack"; import { Badge } from "./badge"; import { EMOJI_PACK, GOAL } from "@/const"; import { useEventFeed } from "@snort/system-react"; interface EventProps { link: NostrLink; } export function EventIcon({ kind }: { kind?: EventKind }) { if (kind === GOAL) { return ; } if (kind === EMOJI_PACK) { return ; } if (kind === EventKind.Badge) { return ; } if (kind === EventKind.TextNote) { return ; } return null; } export function NostrEvent({ ev }: { ev: NostrEventType }) { if (ev?.kind === GOAL) { return (
); } if (ev?.kind === EMOJI_PACK) { return (
); } if (ev?.kind === EventKind.Badge) { return (
); } if (ev?.kind === EventKind.TextNote) { return (
); } return null; } export function Event({ link }: EventProps) { const event = useEventFeed(link); return event ? : null; }