"use client"; /** * Who reacted to a message, and with what. * * Fetched on open rather than shipped with every message: the thread renders * from grouped counts, and sending the full membership of every reaction on * every page would grow with the room. */ import { useEffect, useState } from "react"; import { UserAvatar } from "@/components/ui/user-avatar"; import { ResponsiveDialog } from "@/components/chat/responsive-dialog"; import { chat, type ReactionDetail } from "@/lib/chat"; export function ReactionsDrawer({ conversationId, messageId, onClose, }: { conversationId: string; messageId: string; onClose: () => void; }) { const [rows, setRows] = useState(null); useEffect(() => { let cancelled = false; chat .reactionDetails(conversationId, messageId) .then((r) => { if (!cancelled) setRows(r); }) .catch(() => { if (!cancelled) setRows([]); }); return () => { cancelled = true; }; }, [conversationId, messageId]); return ( {rows === null ? (

Loading…

) : rows.length === 0 ? (

No reactions.

) : ( )}
); }