mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-26 21:37:40 +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>
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { ChatContext } from '@/app/chat-context';
|
|
import { LinkOutlined } from '@ant-design/icons';
|
|
import { useContext } from 'react';
|
|
import ExcelUpload from './excel-upload';
|
|
|
|
interface Props {
|
|
onComplete?: () => void;
|
|
}
|
|
|
|
function ChatExcel({ onComplete }: Props) {
|
|
const { currentDialogue, scene, chatId } = useContext(ChatContext);
|
|
|
|
if (scene !== 'chat_excel') return null;
|
|
|
|
return (
|
|
<div className='max-w-md h-full relative'>
|
|
{currentDialogue ? (
|
|
<div className='flex h-8 overflow-hidden rounded'>
|
|
<div className='flex items-center justify-center px-2 bg-gray-600 text-lg'>
|
|
<LinkOutlined className='text-white' />
|
|
</div>
|
|
<div className='flex items-center justify-center px-3 bg-gray-100 text-xs rounded-tr rounded-br dark:text-gray-800 truncate'>
|
|
{currentDialogue.select_param}
|
|
</div>
|
|
</div>
|
|
) : (
|
|
<ExcelUpload convUid={chatId} chatMode={scene} onComplete={onComplete} />
|
|
)}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default ChatExcel;
|