27 lines
607 B
TypeScript
27 lines
607 B
TypeScript
"use client";
|
||
/**
|
||
* TextBubble 文字气泡
|
||
*
|
||
* 原始 Dart: lib/ui/chat/widgets/text_bubble.dart(41 行)
|
||
*
|
||
* 视觉差异:
|
||
* - AI 消息:白底黑字 + 左上角尖角
|
||
* - 用户消息:渐变(primaryGradient)+ 白字 + 右上角尖角
|
||
*/
|
||
import styles from "./text-bubble.module.css";
|
||
|
||
export interface TextBubbleProps {
|
||
content: string;
|
||
isFromAI: boolean;
|
||
}
|
||
|
||
export function TextBubble({ content, isFromAI }: TextBubbleProps) {
|
||
return (
|
||
<div
|
||
className={`${styles.bubble} ${isFromAI ? styles.bubbleAi : styles.bubbleUser}`}
|
||
>
|
||
{content}
|
||
</div>
|
||
);
|
||
}
|