mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-05-10 17:43:40 +08:00
- 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>
26 lines
773 B
TypeScript
26 lines
773 B
TypeScript
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; |