mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-12 12:37:14 +00:00
feat(ChatExcel): Better Chat Excel (#2423)
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
import markdownComponents from '@/components/chat/chat-content/config';
|
||||
import { IChatDialogueMessageSchema } from '@/types/chat';
|
||||
import { STORAGE_USERINFO_KEY } from '@/utils/constants/index';
|
||||
import { CheckOutlined, ClockCircleOutlined, CloseOutlined, CodeOutlined, LoadingOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
CheckOutlined,
|
||||
ClockCircleOutlined,
|
||||
CloseOutlined,
|
||||
CodeOutlined,
|
||||
CopyOutlined,
|
||||
LoadingOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { GPTVis } from '@antv/gpt-vis';
|
||||
import { message } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import Image from 'next/image';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
@@ -173,8 +181,36 @@ const ChatContent: React.FC<{
|
||||
<div className={`flex ${scene === 'chat_agent' && !thinking ? 'flex-1' : ''} overflow-hidden`}>
|
||||
{/* 用户提问 */}
|
||||
{!isRobot && (
|
||||
<div className='flex flex-1 items-center text-sm text-[#1c2533] dark:text-white'>
|
||||
{typeof context === 'string' && context}
|
||||
<div className='flex flex-1 relative group'>
|
||||
<div
|
||||
className='flex-1 text-sm text-[#1c2533] dark:text-white'
|
||||
style={{ whiteSpace: 'pre-wrap', wordBreak: 'break-word' }}
|
||||
>
|
||||
{typeof context === 'string' && context}
|
||||
</div>
|
||||
{typeof context === 'string' && context.trim() && (
|
||||
<div className='absolute right-0 top-0 opacity-0 group-hover:opacity-100 transition-opacity duration-200'>
|
||||
<button
|
||||
className='flex items-center justify-center w-8 h-8 text-[#525964] dark:text-[rgba(255,255,255,0.6)] hover:text-[#1677ff] dark:hover:text-white transition-colors'
|
||||
onClick={() => {
|
||||
if (typeof context === 'string') {
|
||||
navigator.clipboard
|
||||
.writeText(context)
|
||||
.then(() => {
|
||||
message.success(t('copy_to_clipboard_success'));
|
||||
})
|
||||
.catch(err => {
|
||||
console.error(t('copy_to_clipboard_failed'), err);
|
||||
message.error(t('copy_to_clipboard_failed'));
|
||||
});
|
||||
}
|
||||
}}
|
||||
title={t('copy_to_clipboard')}
|
||||
>
|
||||
<CopyOutlined />
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{/* ai回答 */}
|
||||
|
Reference in New Issue
Block a user