import Row from "@moduletrace/twui/layout/Row"; import type { BotMessageReactionEmoji } from "@/src/dict/bot-dict"; import type { BotMessageReaction } from "@/src/types"; import MessageReactionChip from "./message-reaction-chip"; type Props = { message_id: number; reactions?: BotMessageReaction[]; /** * Left out where the reactions only show (the user's own messages). */ onReact?: (params: { message_id: number; emoji: BotMessageReactionEmoji }) => void; }; /** * The reactions a message has, one chip per emoji, each toggleable when * `onReact` is given. */ export default function MessageReactions({ message_id, reactions, onReact }: Props) { if (!reactions?.length) return null; return ( {reactions.map((reaction) => ( onReact({ message_id, emoji: reaction.emoji }) : undefined} /> ))} ); }