fix: pass zap request event to RichText for emoji rendering in compact preview

The compact zap preview was passing only the content string to RichText,
which meant NIP-30 custom emoji tags were not available for rendering.
Now passes the full zap request event so emoji tags are properly parsed.
This commit is contained in:
Claude
2026-01-19 09:10:36 +00:00
parent b000ef8dd3
commit 77c3204267

View File

@@ -21,12 +21,6 @@ export function ZapCompactPreview({ event }: { event: NostrEvent }) {
const zapRequest = useMemo(() => getZapRequest(event), [event]);
const zapRecipient = useMemo(() => getZapRecipient(event), [event]);
// Get zap comment from request
const zapMessage = useMemo(() => {
if (!zapRequest) return null;
return zapRequest.content || null;
}, [zapRequest]);
// Get zapped content pointers
const eventPointer = useMemo(() => getZapEventPointer(event), [event]);
const addressPointer = useMemo(() => getZapAddressPointer(event), [event]);
@@ -49,10 +43,10 @@ export function ZapCompactPreview({ event }: { event: NostrEvent }) {
{amountInSats.toLocaleString("en", { notation: "compact" })}
</span>
{zapRecipient && <UserName pubkey={zapRecipient} />}
{zapMessage && (
{zapRequest?.content && (
<span className="truncate line-clamp-1 flex-shrink-0">
<RichText
content={zapMessage}
event={zapRequest}
className="inline text-sm leading-none"
options={{ showMedia: false, showEventEmbeds: false }}
/>