mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-07-09 06:22:48 +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: {
|
user: {
|
||||||
placement: 'end' as const,
|
placement: 'end' as const,
|
||||||
avatar: {
|
avatar: (
|
||||||
icon: <UserRound className="h-4 w-4" />,
|
<div className="flex h-7 w-7 items-center justify-center rounded-full bg-blue-500 text-white">
|
||||||
style: { background: '#3b82f6' },
|
<UserRound className="h-4 w-4" />
|
||||||
},
|
</div>
|
||||||
|
),
|
||||||
variant: 'filled' as const,
|
variant: 'filled' as const,
|
||||||
styles: { content: { background: '#3b82f6', color: '#fff' } },
|
styles: { content: { background: '#3b82f6', color: '#fff' } },
|
||||||
},
|
},
|
||||||
ai: {
|
ai: {
|
||||||
placement: 'start' as const,
|
placement: 'start' as const,
|
||||||
avatar: {
|
avatar: (
|
||||||
icon: <Bot className="h-4 w-4" />,
|
<div className="flex h-7 w-7 items-center justify-center rounded-full bg-neutral-500 text-white">
|
||||||
style: { background: '#6b7280' },
|
<Bot className="h-4 w-4" />
|
||||||
},
|
</div>
|
||||||
|
),
|
||||||
variant: 'outlined' as const,
|
variant: 'outlined' as const,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user