-
Profile Badges
+
{heading}
•
diff --git a/src/components/nostr/kinds/ProfileBadgesRenderer.tsx b/src/components/nostr/kinds/ProfileBadgesRenderer.tsx
index 5d09a65..c60b0e9 100644
--- a/src/components/nostr/kinds/ProfileBadgesRenderer.tsx
+++ b/src/components/nostr/kinds/ProfileBadgesRenderer.tsx
@@ -13,6 +13,7 @@ import {
getBadgeImageUrl,
} from "@/lib/nip58-helpers";
import { Award } from "lucide-react";
+import { getTagValue } from "applesauce-core/helpers";
/**
* Parse an address pointer from an a tag value
@@ -78,6 +79,8 @@ function BadgeItem({ badgeAddress }: { badgeAddress: string }) {
*/
export function ProfileBadgesRenderer({ event }: BaseEventProps) {
const badgePairs = getProfileBadgePairs(event);
+ const isProfileBadges = getTagValue(event, "d") === "profile_badges";
+ const heading = isProfileBadges ? "Profile Badges" : "Badge Set";
const MAX_VISIBLE_BADGES = 5;
const visibleBadges = badgePairs.slice(0, MAX_VISIBLE_BADGES);
const remainingCount = Math.max(0, badgePairs.length - MAX_VISIBLE_BADGES);
@@ -101,7 +104,8 @@ export function ProfileBadgesRenderer({ event }: BaseEventProps) {
event={event}
className="text-sm font-semibold text-foreground hover:text-foreground/80"
>
- {badgePairs.length} {badgePairs.length === 1 ? "badge" : "badges"}
+ {heading}: {badgePairs.length}{" "}
+ {badgePairs.length === 1 ? "badge" : "badges"}
{/* Limited Badge Thumbnails */}
diff --git a/src/components/nostr/kinds/index.tsx b/src/components/nostr/kinds/index.tsx
index 78ff2da..538b436 100644
--- a/src/components/nostr/kinds/index.tsx
+++ b/src/components/nostr/kinds/index.tsx
@@ -268,6 +268,7 @@ const kindRenderers: Record> = {
30005: VideoCurationSetRenderer, // Video Curation Sets (NIP-51)
30006: PictureCurationSetRenderer, // Picture Curation Sets (NIP-51)
30007: KindMuteSetRenderer, // Kind Mute Sets (NIP-51)
+ 10008: ProfileBadgesRenderer, // Profile Badges (NIP-58)
30008: ProfileBadgesRenderer, // Profile Badges (NIP-58)
30009: BadgeDefinitionRenderer, // Badge (NIP-58)
30015: InterestSetRenderer, // Interest Sets (NIP-51)
@@ -388,6 +389,7 @@ const detailRenderers: Record<
30005: VideoCurationSetDetailRenderer, // Video Curation Sets Detail (NIP-51)
30006: PictureCurationSetDetailRenderer, // Picture Curation Sets Detail (NIP-51)
30007: KindMuteSetDetailRenderer, // Kind Mute Sets Detail (NIP-51)
+ 10008: ProfileBadgesDetailRenderer, // Profile Badges Detail (NIP-58)
30008: ProfileBadgesDetailRenderer, // Profile Badges Detail (NIP-58)
30009: BadgeDefinitionDetailRenderer, // Badge Detail (NIP-58)
30015: InterestSetDetailRenderer, // Interest Sets Detail (NIP-51)
diff --git a/src/constants/kinds.ts b/src/constants/kinds.ts
index 8c64189..93572e1 100644
--- a/src/constants/kinds.ts
+++ b/src/constants/kinds.ts
@@ -790,6 +790,13 @@ export const EVENT_KINDS: Record = {
nip: "51",
icon: Search,
},
+ 10008: {
+ kind: 10008,
+ name: "Profile Badge",
+ description: "Profile Badges",
+ nip: "58",
+ icon: Award,
+ },
10009: {
kind: 10009,
name: "User Group List",
@@ -1183,8 +1190,8 @@ export const EVENT_KINDS: Record = {
},
30008: {
kind: 30008,
- name: "Profile Badge",
- description: "Profile Badges",
+ name: "Badge Set",
+ description: "Badge Set",
nip: "58",
icon: Award,
},