mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-06 20:42:52 +08:00
fix(chat): 修复 avatar 传对象导致 React 渲染报错
avatar 属性类型是 ReactNode,不是 props 对象, 改为直接传 JSX 元素作为头像。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -164,19 +164,21 @@ export default function ChatPanel({ taskId, mode, onModeChange }: ChatPanelProps
|
||||
() => ({
|
||||
user: {
|
||||
placement: 'end' as const,
|
||||
avatar: {
|
||||
icon: <UserRound className="h-4 w-4" />,
|
||||
style: { background: '#3b82f6' },
|
||||
},
|
||||
avatar: (
|
||||
<div className="flex h-7 w-7 items-center justify-center rounded-full bg-blue-500 text-white">
|
||||
<UserRound className="h-4 w-4" />
|
||||
</div>
|
||||
),
|
||||
variant: 'filled' as const,
|
||||
styles: { content: { background: '#3b82f6', color: '#fff' } },
|
||||
},
|
||||
ai: {
|
||||
placement: 'start' as const,
|
||||
avatar: {
|
||||
icon: <Bot className="h-4 w-4" />,
|
||||
style: { background: '#6b7280' },
|
||||
},
|
||||
avatar: (
|
||||
<div className="flex h-7 w-7 items-center justify-center rounded-full bg-neutral-500 text-white">
|
||||
<Bot className="h-4 w-4" />
|
||||
</div>
|
||||
),
|
||||
variant: 'outlined' as const,
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user