diff --git a/src/components/nostr/kinds/TrustedAssertionDetailRenderer.tsx b/src/components/nostr/kinds/TrustedAssertionDetailRenderer.tsx index 1d3c890..472eb99 100644 --- a/src/components/nostr/kinds/TrustedAssertionDetailRenderer.tsx +++ b/src/components/nostr/kinds/TrustedAssertionDetailRenderer.tsx @@ -1,5 +1,6 @@ import { NostrEvent } from "@/types/nostr"; import { UserName } from "../UserName"; +import { QuotedEvent } from "../QuotedEvent"; import { ExternalIdentifierBlock } from "../ExternalIdentifierDisplay"; import { getAssertionSubject, @@ -11,12 +12,13 @@ import { ASSERTION_KIND_LABELS, ASSERTION_TAG_LABELS, } from "@/lib/nip85-helpers"; +import { parseReplaceableAddress } from "applesauce-core/helpers/pointers"; import { getExternalIdentifierIcon, getExternalTypeLabel, } from "@/lib/nip73-helpers"; import { formatTimestamp } from "@/hooks/useLocale"; -import { ShieldCheck, User, FileText, Hash } from "lucide-react"; +import { ShieldCheck, User, Hash } from "lucide-react"; import { Progress } from "@/components/ui/progress"; import { cn } from "@/lib/utils"; @@ -119,32 +121,14 @@ function SubjectHeader({ ); } - // Kind 30384: addressable event (kind:pubkey:d-tag) + // Kind 30384: addressable event — quote the referenced event if (event.kind === 30384) { - const parts = subject.split(":"); - if (parts.length >= 3) { - return ( -
- - - Kind {parts[0]} by{" "} - - {parts[2] && ( - / {parts[2]} - )} - -
- ); - } + const pointer = parseReplaceableAddress(subject); + if (pointer) return ; } - // Kind 30383: event ID - return ( -
- - {subject} -
- ); + // Kind 30383: event ID — quote the referenced event + return ; } /** diff --git a/src/components/nostr/kinds/TrustedAssertionRenderer.tsx b/src/components/nostr/kinds/TrustedAssertionRenderer.tsx index c61a8ab..2f70c86 100644 --- a/src/components/nostr/kinds/TrustedAssertionRenderer.tsx +++ b/src/components/nostr/kinds/TrustedAssertionRenderer.tsx @@ -5,6 +5,7 @@ import { } from "./BaseEventRenderer"; import { Label } from "@/components/ui/label"; import { UserName } from "../UserName"; +import { QuotedEvent } from "../QuotedEvent"; import { ExternalIdentifierInline } from "../ExternalIdentifierDisplay"; import { getAssertionSubject, @@ -16,6 +17,7 @@ import { ASSERTION_KIND_LABELS, ASSERTION_TAG_LABELS, } from "@/lib/nip85-helpers"; +import { parseReplaceableAddress } from "applesauce-core/helpers/pointers"; import { Progress } from "@/components/ui/progress"; import { cn } from "@/lib/utils"; @@ -47,7 +49,7 @@ function RankBar({ rank }: { rank: number }) { } /** - * Subject as the visual anchor — rendered as ClickableEventTitle + * Subject as the visual anchor — rendered as ClickableEventTitle or QuotedEvent */ function SubjectTitle({ event, @@ -83,31 +85,14 @@ function SubjectTitle({ ); } + // Kind 30384: addressable event — quote inline if (event.kind === 30384) { - const parts = subject.split(":"); - const display = - parts.length >= 3 - ? `${parts[0]}:${parts[1].slice(0, 8)}...:${parts[2] || "*"}` - : subject; - return ( - - {display} - - ); + const pointer = parseReplaceableAddress(subject); + if (pointer) return ; } - // Event ID (30383) - return ( - - {subject.slice(0, 16)}... - - ); + // Kind 30383: event ID — quote inline + return ; } /**