- render badges in cards - render mentioned badges in chat - render host badge awards in chat - render accepted badges next to username
25 lines
528 B
TypeScript
25 lines
528 B
TypeScript
import { type NostrLink, EventKind } from "@snort/system";
|
|
|
|
import { useEvent } from "hooks/event";
|
|
import { EMOJI_PACK } from "const";
|
|
import { EmojiPack } from "element/emoji-pack";
|
|
import { Badge } from "element/badge";
|
|
|
|
interface AddressProps {
|
|
link: NostrLink;
|
|
}
|
|
|
|
export function Address({ link }: AddressProps) {
|
|
const event = useEvent(link);
|
|
|
|
if (event?.kind === EMOJI_PACK) {
|
|
return <EmojiPack ev={event} />;
|
|
}
|
|
|
|
if (event?.kind === EventKind.Badge) {
|
|
return <Badge ev={event} />;
|
|
}
|
|
|
|
return null;
|
|
}
|