mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-06-05 10:11:12 +02:00
feat: render highlight comments with RichText component
Enable support for custom emoji, mentions, hashtags, and other rich text features in highlight comments by using the RichText component instead of plain text rendering. Changes: - HighlightRenderer: Use RichText for comment rendering with media/embeds disabled - HighlightDetailRenderer: Add RichText import and use it for comment rendering
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
import { EmbeddedEvent } from "../EmbeddedEvent";
|
||||
import { UserName } from "../UserName";
|
||||
import { useGrimoire } from "@/core/state";
|
||||
import { RichText } from "../RichText";
|
||||
|
||||
/**
|
||||
* Detail renderer for Kind 9802 - Highlight
|
||||
@@ -80,7 +81,11 @@ export function Kind9802DetailRenderer({ event }: { event: NostrEvent }) {
|
||||
<div className="text-xs text-muted-foreground uppercase tracking-wide">
|
||||
Comment
|
||||
</div>
|
||||
<p className="text-sm leading-relaxed">{comment}</p>
|
||||
<RichText
|
||||
content={comment}
|
||||
className="text-sm leading-relaxed"
|
||||
options={{ showMedia: false, showEventEmbeds: false }}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
@@ -53,7 +53,13 @@ export function Kind9802Renderer({ event }: BaseEventProps) {
|
||||
<BaseEventContainer event={event}>
|
||||
<div className="flex flex-col gap-2">
|
||||
{/* Comment */}
|
||||
{comment && <p className="text-sm text-foreground">{comment}</p>}
|
||||
{comment && (
|
||||
<RichText
|
||||
content={comment}
|
||||
className="text-sm text-foreground"
|
||||
options={{ showMedia: false, showEventEmbeds: false }}
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Highlighted text */}
|
||||
{highlightText && (
|
||||
|
||||
Reference in New Issue
Block a user