"use client"; /** * The emoji row at the top of a message's long-press menu. * * Five quick reactions plus a "+" that opens the full set — a drawer on * mobile, a modal on desktop, reusing ResponsiveDialog so it behaves like * every other chat surface. * * It sits inside the context menu rather than being its own popover: long * press is one gesture, and two surfaces competing for it would mean neither * felt reliable. */ import { useState } from "react"; import { Plus } from "lucide-react"; import { EMOJI_GROUPS } from "@/components/ui/emoji-picker"; import { ResponsiveDialog } from "@/components/chat/responsive-dialog"; import { cn } from "@/lib/utils"; /** What a double-tap sends. Matches the server's own default. */ export const HEART_EMOJI = "❤️"; /** The five offered without opening the full set. */ export const QUICK_REACTIONS = [HEART_EMOJI, "😂", "🙏", "😮", "😢"]; export function ReactionRow({ current, onPick, }: { /** The viewer's existing reaction, so it can be shown as selected. */ current?: string; /** Picking the current emoji again clears it — the caller decides. */ onPick: (emoji: string) => void; }) { const [browsing, setBrowsing] = useState(false); return ( <>
{QUICK_REACTIONS.map((emoji) => ( ))}
{browsing && ( setBrowsing(false)} >
{EMOJI_GROUPS.map((group) => (

{group.label}

{group.emojis.map((emoji) => ( ))}
))}
)} ); }