"use client"; import { X } from "lucide-react"; import { cn } from "@/lib/utils"; import type { Message } from "@/types"; interface ReplyQuoteProps { /** Sender label of the quoted message: "You" for our own messages, * contact name for customer-sent messages. Caller resolves this — the * quote component doesn't see the parent Message. */ authorLabel: string; /** Compact text preview. Falls back to a placeholder for media types. */ preview: string; /** Present → renders the composer-chip variant with an X button. Absent → * renders the embedded-in-bubble variant. */ onDismiss?: () => void; } export function ReplyQuote({ authorLabel, preview, onDismiss, }: ReplyQuoteProps) { const isChip = !!onDismiss; return (
{authorLabel}
{preview}
{onDismiss && ( )}
); } /** Build the one-line preview text shown inside a reply quote. */ export function buildReplyPreview(message: Message): string { if (message.content_text) return message.content_text; switch (message.content_type) { case "image": return "[Image]"; case "video": return "[Video]"; case "audio": return "[Audio]"; case "document": return "[Document]"; case "location": return "[Location]"; case "template": return "[Template]"; default: return "[Message]"; } }