export const QUICK_REACTIONS = ["❤️", "😂", "👍", "😮", "😢", "🙏"] as const;

export type MessageReaction = {
  userId: string;
  emoji: string;
};

export function groupReactions(reactions: MessageReaction[] | undefined) {
  if (!reactions?.length) return [];
  const map = new Map<string, number>();
  for (const r of reactions) {
    map.set(r.emoji, (map.get(r.emoji) ?? 0) + 1);
  }
  return [...map.entries()].map(([emoji, count]) => ({ emoji, count }));
}
