Files
BiliNote/BillNote_frontend/src/components/Icons/index.tsx
huangjianwu 108ad270bf fix: 修复 AILogo 噪音、设置页滚动与供应商批量伪内置脏数据
- AILogo: `custom` 名称为合法兜底场景,不再以 console.error 上报;其余未匹配名称降级为 console.warn
- SettingPage/Model: 双栏加 `min-h-0 overflow-y-auto`,让供应商列表与右侧表单各自可滚动
- ProviderService.add_provider: API 创建一律落到 `type='custom'`,并对同名供应商抛 ValueError,避免再产生伪内置行
- CLAUDE.md: 补充 v2.0.0 子系统(RAG/Chat、可选 Nacos+RabbitMQ、i18n、cookie/transcriber 管理器)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 11:10:15 +08:00

26 lines
773 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import * as Icons from '@lobehub/icons';
interface AILogoProps {
name: string; // 图标名称(区分大小写!如 OpenAI、DeepSeek
style?: 'Color' | 'Text' | 'Outlined' | 'Glyph';
size?: number;
}
const AILogo = ({ name, style = 'Color', size = 24 }: AILogoProps) => {
const Icon = name ? Icons[name as keyof typeof Icons] : undefined;
if (!Icon) {
if (name && name !== 'custom') {
console.warn(`AILogo: 未匹配到图标,使用占位: ${name}`);
}
return <span style={{ fontSize: size }}>🚫</span>;
}
const Variant = Icon[style as keyof typeof Icon];
if (!Variant) {
return <Icon size={size} />;
}
return <Variant size={size} />;
};
export default AILogo;