"use client"; import { motion, useReducedMotion } from "motion/react"; import type { ReactNode } from "react"; import { cn } from "@/lib/utils"; export type MessageBubbleTone = "neutral" | "accent"; export type MessageBubbleAlign = "start" | "end"; export interface MessageBubbleProps { /** Which side the bubble sits on, matching who sent it. Default "start". */ align?: MessageBubbleAlign; /** Visual treatment. Default "neutral". */ tone?: MessageBubbleTone; children: ReactNode; className?: string; } const TONE_CLASS: Record = { neutral: "bg-card text-foreground shadow-[0_0_0_1px_var(--border)]", accent: "bg-accent text-accent-foreground", }; const EASE = [0.23, 1, 0.32, 1] as const; /** A chat message surface with a speech-bubble tail that pops in from the side it belongs to. */ export function MessageBubble({ align = "start", tone = "neutral", children, className, }: MessageBubbleProps) { const reduce = useReducedMotion(); const fromX = align === "end" ? 10 : -10; return ( {children} ); }