feedback formatter

This commit is contained in:
gosangam
2026-10-09 06:40:28 +05:30
parent cce8a4c05f
commit 9f67da37a6
2 changed files with 125 additions and 3 deletions
+10 -3
View File
@@ -28,6 +28,7 @@ import {
type AppNotification,
type UserSummary,
} from "@/lib/social";
import { RichText } from "@/lib/rich-text";
import { UserAvatar } from "@/components/ui/user-avatar";
import { Button } from "@/components/ui/button";
import { timeAgo } from "@/lib/time";
@@ -275,10 +276,16 @@ function NotificationRow({
<UserAvatar src={isAdmin ? null : n.actor_avatar_url} name={display} />
<div className="min-w-0 flex-1">
{isAdmin ? (
<p className="text-sm text-foreground leading-snug whitespace-pre-line">
// A div, not a <p>: the formatted body nests elements, and RichText
// handles line breaks itself (so no whitespace-pre-line either).
<div className="text-sm text-foreground leading-snug">
<span className="font-semibold">{display}</span>
{n.body ? <span className="block mt-0.5">{n.body}</span> : null}
</p>
{n.body ? (
<span className="block mt-0.5">
<RichText text={n.body} />
</span>
) : null}
</div>
) : (
<p className="text-sm text-foreground leading-snug">
<span className="font-semibold">{display}</span> {message}