feat: Hide the upload button in the external agent's chat box #1880 (#1984)

### What problem does this PR solve?

feat: Hide the upload button in the external agent's chat box  #1880

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-08-16 18:50:48 +08:00
committed by GitHub
parent 4121636084
commit 8e75a23ad0
5 changed files with 37 additions and 8 deletions

View File

@ -1,11 +1,12 @@
import MessageInput from '@/components/message-input';
import MessageItem from '@/components/message-item';
import { MessageType } from '@/constants/chat';
import { MessageType, SharedFrom } from '@/constants/chat';
import { useSendButtonDisabled } from '@/pages/chat/hooks';
import { Flex, Spin } from 'antd';
import { forwardRef } from 'react';
import {
useCreateSharedConversationOnMount,
useGetSharedChatSearchParams,
useSelectCurrentSharedConversation,
useSendSharedMessage,
} from '../shared-hooks';
@ -37,6 +38,7 @@ const ChatContainer = () => {
addNewestAnswer,
);
const sendDisabled = useSendButtonDisabled(value);
const { from } = useGetSharedChatSearchParams();
return (
<>
@ -74,6 +76,7 @@ const ChatContainer = () => {
onPressEnter={handlePressEnter}
sendLoading={sendLoading}
uploadUrl="/v1/api/document/upload_and_parse"
showUploadIcon={from === SharedFrom.Chat}
></MessageInput>
</Flex>
</>