mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-28 13:00:02 +00:00
Co-authored-by: 夏姜 <wenfengjiang.jwf@digital-engine.com> Co-authored-by: yhjun1026 <460342015@qq.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: wb-lh513319 <wb-lh513319@alibaba-inc.com>
32 lines
1021 B
TypeScript
32 lines
1021 B
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;
|