mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-26 10:23:28 +08:00
Feat: If the interval between two outputs exceeds 600ms, a loading state is displayed at the end. (#16861)
### Summary Feat: If the interval between two outputs exceeds 600ms, a loading state is displayed at the end.
This commit is contained in:
@@ -18,6 +18,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import 'katex/dist/katex.min.css'; // `rehype-katex` does not import the CSS for you
|
||||
|
||||
import { useFetchDocumentThumbnailsByIds } from '@/hooks/use-document-request';
|
||||
import { useLoadingPause } from '@/hooks/use-loading-pause';
|
||||
import {
|
||||
currentReg,
|
||||
parseCitationIndex,
|
||||
@@ -30,6 +31,7 @@ import classNames from 'classnames';
|
||||
import { omit } from 'lodash';
|
||||
import { pipe } from 'lodash/fp';
|
||||
import reactStringReplace from 'react-string-replace';
|
||||
import { LoadingDots } from '../loading-dots';
|
||||
import { Button } from '../ui/button';
|
||||
import {
|
||||
HoverCard,
|
||||
@@ -52,6 +54,7 @@ const MarkdownContent = ({
|
||||
reference,
|
||||
clickDocumentButton,
|
||||
content,
|
||||
loading,
|
||||
}: {
|
||||
content: string;
|
||||
loading: boolean;
|
||||
@@ -260,6 +263,7 @@ const MarkdownContent = ({
|
||||
);
|
||||
|
||||
const dir = getDirAttribute(content.replace(citationMarkerReg, ''));
|
||||
const showLoadingDots = useLoadingPause(loading, content);
|
||||
|
||||
return (
|
||||
<div dir={dir} className={styles.markdownContentWrapper}>
|
||||
@@ -298,6 +302,9 @@ const MarkdownContent = ({
|
||||
>
|
||||
{contentWithCursor}
|
||||
</Markdown>
|
||||
{showLoadingDots && (
|
||||
<LoadingDots className="ml-1 inline-block text-text-secondary" />
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user