feat: render emoji packs and goals in cards
This commit is contained in:
33
src/element/Event.tsx
Normal file
33
src/element/Event.tsx
Normal file
@ -0,0 +1,33 @@
|
||||
import "./event.css";
|
||||
|
||||
import { type NostrLink, EventKind } from "@snort/system";
|
||||
import { useEvent } from "hooks/event";
|
||||
import { GOAL } from "const";
|
||||
import { Goal } from "element/goal";
|
||||
import { Note } from "element/note";
|
||||
|
||||
interface EventProps {
|
||||
link: NostrLink;
|
||||
}
|
||||
|
||||
export function Event({ link }: EventProps) {
|
||||
const event = useEvent(link);
|
||||
|
||||
if (event && event.kind === GOAL) {
|
||||
return (
|
||||
<div className="event-container">
|
||||
<Goal ev={event} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (event && event.kind === EventKind.TextNote) {
|
||||
return (
|
||||
<div className="event-container">
|
||||
<Note ev={event} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return <code>{link.id}</code>;
|
||||
}
|
Reference in New Issue
Block a user