interface ChatBubbleProps { role: 'user' | 'assistant'; content: string; companionName?: string; userNickname?: string; } export default function ChatBubble({ role, content, companionName = 'AI', userNickname = '你', }: ChatBubbleProps) { const isUser = role === 'user'; return (
{/* Avatar */}
{isUser ? userNickname.charAt(0) : '🤖'}
{/* Bubble */}
{!isUser && ( {companionName} )} {content}
); }