Files
eosphoros-ai--db-gpt/web/new-components/common/AppDefaultIcon.tsx
T
wehub-resource-sync d13100ebf3
Update draft releases / main (push) Has been cancelled
Build and push docs image / build-image (push) Has been cancelled
Build Web Application / build-web (macos-latest) (push) Has been cancelled
Build Web Application / build-web (ubuntu-latest) (push) Has been cancelled
Python Code Quality Checks / build (push) Has been cancelled
Test Python / test-python (macos-latest, 3.10) (push) Has been cancelled
Test Python / test-python (macos-latest, 3.11) (push) Has been cancelled
Test Python / test-python (ubuntu-latest, 3.10) (push) Has been cancelled
Test Python / test-python (ubuntu-latest, 3.11) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:27:08 +08:00

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;