mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-29 06:47:30 +00:00
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: 谨欣 <echo.cmy@antgroup.com> Co-authored-by: 严志勇 <yanzhiyong@tiansuixiansheng.com> Co-authored-by: yanzhiyong <932374019@qq.com>
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import {
|
|
ColorfulChat,
|
|
ColorfulDB,
|
|
ColorfulDashboard,
|
|
ColorfulData,
|
|
ColorfulDoc,
|
|
ColorfulExcel,
|
|
ColorfulPlugin,
|
|
} from '@/components/icons';
|
|
import Icon from '@ant-design/icons';
|
|
import React, { useCallback } from 'react';
|
|
|
|
const AppDefaultIcon: React.FC<{ scene: string; width?: number; height?: number }> = ({ width, height, scene }) => {
|
|
const returnComponent = useCallback(() => {
|
|
switch (scene) {
|
|
case 'chat_knowledge':
|
|
return ColorfulDoc;
|
|
case 'chat_with_db_execute':
|
|
return ColorfulData;
|
|
case 'chat_excel':
|
|
return ColorfulExcel;
|
|
case 'chat_with_db_qa':
|
|
case 'chat_dba':
|
|
return ColorfulDB;
|
|
case 'chat_dashboard':
|
|
return ColorfulDashboard;
|
|
case 'chat_agent':
|
|
return ColorfulPlugin;
|
|
case 'chat_normal':
|
|
return ColorfulChat;
|
|
default:
|
|
return;
|
|
}
|
|
}, [scene]);
|
|
|
|
return <Icon className={`w-${width || 7} h-${height || 7}`} component={returnComponent()} />;
|
|
};
|
|
|
|
export default AppDefaultIcon;
|