feat(chat): port chat widget components from Dart to React
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
"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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user