refactor(聊天头部): 使用 IconRenderer 组件渲染助手图标
- 替换原有的 emoji 图标为 IconRenderer 组件 - 支持 Lucide 图标和表情符号的统一渲染 - 优化图标样式和主题色适配
This commit is contained in:
parent
372946de9d
commit
600d899532
@ -3,6 +3,7 @@
|
|||||||
import { useState, useRef, useEffect } from 'react';
|
import { useState, useRef, useEffect } from 'react';
|
||||||
import { ChevronDown, Check, Bot } from 'lucide-react';
|
import { ChevronDown, Check, Bot } from 'lucide-react';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
import { IconRenderer } from '@/components/ui/IconRenderer';
|
||||||
|
|
||||||
interface Assistant {
|
interface Assistant {
|
||||||
id: number;
|
id: number;
|
||||||
@ -82,7 +83,12 @@ export function ChatHeaderInfo({
|
|||||||
<div className="flex items-center gap-1.5 text-[var(--color-text-secondary)]">
|
<div className="flex items-center gap-1.5 text-[var(--color-text-secondary)]">
|
||||||
{assistant ? (
|
{assistant ? (
|
||||||
<>
|
<>
|
||||||
<span className="text-base">{assistant.icon || '🤖'}</span>
|
<IconRenderer
|
||||||
|
icon={assistant.icon}
|
||||||
|
size={16}
|
||||||
|
fallback="Bot"
|
||||||
|
className="text-[var(--color-primary)]"
|
||||||
|
/>
|
||||||
<span className="font-medium">{assistant.name}</span>
|
<span className="font-medium">{assistant.name}</span>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user