mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
feat: Add Skeleton to MessageItem before the backend returns a message and fixed the issue where ChatConfigurationModal displays old data when creating a new dialog (#99)
* feat: fixed the issue where ChatConfigurationModal displays old data when creating a new dialog * feat: Add Skeleton to MessageItem before the backend returns a message
This commit is contained in:
@ -11,6 +11,7 @@ import {
|
||||
Input,
|
||||
List,
|
||||
Popover,
|
||||
Skeleton,
|
||||
Space,
|
||||
} from 'antd';
|
||||
import classNames from 'classnames';
|
||||
@ -100,7 +101,12 @@ const MessageItem = ({
|
||||
></Image>
|
||||
</Popover>
|
||||
<Space direction={'vertical'}>
|
||||
<div>{chunkItem?.content_with_weight}</div>
|
||||
<div
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: chunkItem?.content_with_weight,
|
||||
}}
|
||||
className={styles.chunkContentText}
|
||||
></div>
|
||||
{documentId && (
|
||||
<Flex gap={'middle'}>
|
||||
<img src={fileThumbnails[documentId]} alt="" />
|
||||
@ -171,17 +177,24 @@ const MessageItem = ({
|
||||
<Flex vertical gap={8} flex={1}>
|
||||
<b>{isAssistant ? '' : userInfo.nickname}</b>
|
||||
<div className={styles.messageText}>
|
||||
<Markdown
|
||||
rehypePlugins={[rehypeWrapReference]}
|
||||
components={
|
||||
{
|
||||
'custom-typography': ({ children }: { children: string }) =>
|
||||
renderReference(children),
|
||||
} as any
|
||||
}
|
||||
>
|
||||
{item.content}
|
||||
</Markdown>
|
||||
{item.content ? (
|
||||
<Markdown
|
||||
rehypePlugins={[rehypeWrapReference]}
|
||||
components={
|
||||
{
|
||||
'custom-typography': ({
|
||||
children,
|
||||
}: {
|
||||
children: string;
|
||||
}) => renderReference(children),
|
||||
} as any
|
||||
}
|
||||
>
|
||||
{item.content}
|
||||
</Markdown>
|
||||
) : (
|
||||
<Skeleton active className={styles.messageEmpty} />
|
||||
)}
|
||||
</div>
|
||||
{isAssistant && referenceDocumentList.length > 0 && (
|
||||
<List
|
||||
|
||||
Reference in New Issue
Block a user