diff --git a/app/(app)/notifications/page.tsx b/app/(app)/notifications/page.tsx index bab81e83..c3c46873 100644 --- a/app/(app)/notifications/page.tsx +++ b/app/(app)/notifications/page.tsx @@ -115,7 +115,11 @@ function NotificationRow({ n: AppNotification; selfHandle: string; }) { - const display = n.actor_name || (n.actor_handle ? `@${n.actor_handle}` : "Someone"); + // admin_message rows have no actor — they're a direct message from the team. + const isAdmin = n.kind === "admin_message"; + const display = isAdmin + ? "Prabhupāda Says" + : n.actor_name || (n.actor_handle ? `@${n.actor_handle}` : "Someone"); const message = messageFor(n); const unread = !n.read_at; @@ -123,11 +127,18 @@ function NotificationRow({
- +
-

- {display} {message} -

+ {isAdmin ? ( +

+ {display} + {n.body ? {n.body} : null} +

+ ) : ( +

+ {display} {message} +

+ )}

{timeAgo(n.created_at)}

@@ -194,6 +205,8 @@ function messageFor(n: AppNotification): string { return "replied to your comment."; case "comment_mention": return "mentioned you in a comment."; + case "admin_message": + return n.body ?? "sent you a message."; default: return "sent you a notification."; } diff --git a/components/notifications/notifications-provider.tsx b/components/notifications/notifications-provider.tsx index 7426b9df..2d808c49 100644 --- a/components/notifications/notifications-provider.tsx +++ b/components/notifications/notifications-provider.tsx @@ -49,6 +49,7 @@ type IncomingEvent = { actor_name?: string; actor_handle?: string; actor_avatar_url?: string | null; + body?: string | null; }; function messageFor(e: IncomingEvent): string { @@ -69,6 +70,8 @@ function messageFor(e: IncomingEvent): string { return `${who} replied to your comment`; case "comment_mention": return `${who} mentioned you in a comment`; + case "admin_message": + return e.body || "A message from Prabhupāda Says"; default: return "You have a new notification"; } diff --git a/lib/social.ts b/lib/social.ts index 87f66f10..10f95cea 100644 --- a/lib/social.ts +++ b/lib/social.ts @@ -627,6 +627,9 @@ export type AppNotification = { * / reply notifications can deep-link to the post even though the actor * isn't its owner. */ post_author_handle?: string | null; + /** Free text for the `admin_message` kind (an admin → user direct message). + * Absent on every event-driven kind. */ + body?: string | null; }; export const notifications = {