### What problem does this PR solve? feat: Add MessageInput to the external chat page #1880 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import MessageInput from '@/components/message-input';
|
||||
import MessageItem from '@/components/message-item';
|
||||
import { MessageType } from '@/constants/chat';
|
||||
import { useTranslate } from '@/hooks/common-hooks';
|
||||
import { useSendButtonDisabled } from '@/pages/chat/hooks';
|
||||
import { Button, Flex, Input, Spin } from 'antd';
|
||||
import { Flex, Spin } from 'antd';
|
||||
import { forwardRef } from 'react';
|
||||
import {
|
||||
useCreateSharedConversationOnMount,
|
||||
@@ -10,11 +10,9 @@ import {
|
||||
useSendSharedMessage,
|
||||
} from '../shared-hooks';
|
||||
import { buildMessageItemReference } from '../utils';
|
||||
|
||||
import styles from './index.less';
|
||||
|
||||
const ChatContainer = () => {
|
||||
const { t } = useTranslate('chat');
|
||||
const { conversationId } = useCreateSharedConversationOnMount();
|
||||
const {
|
||||
currentConversation: conversation,
|
||||
@@ -65,24 +63,17 @@ const ChatContainer = () => {
|
||||
</div>
|
||||
<div ref={ref} />
|
||||
</Flex>
|
||||
<Input
|
||||
size="large"
|
||||
placeholder={t('sendPlaceholder')}
|
||||
|
||||
<MessageInput
|
||||
value={value}
|
||||
// disabled={disabled}
|
||||
suffix={
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={handlePressEnter}
|
||||
loading={sendLoading}
|
||||
disabled={sendDisabled}
|
||||
>
|
||||
{t('send')}
|
||||
</Button>
|
||||
}
|
||||
disabled={false}
|
||||
sendDisabled={sendDisabled}
|
||||
conversationId={conversationId}
|
||||
onInputChange={handleInputChange}
|
||||
onPressEnter={handlePressEnter}
|
||||
onChange={handleInputChange}
|
||||
/>
|
||||
sendLoading={sendLoading}
|
||||
uploadUrl="/v1/api/document/upload_and_parse"
|
||||
></MessageInput>
|
||||
</Flex>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user