mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-04 02:45:11 +08:00
### What problem does this PR solve? Feat: Show images in reply messages #7608 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
01330fa428
commit
fe3b2acde0
@ -17,8 +17,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.referenceChunkImage {
|
.referenceChunkImage {
|
||||||
width: 10vw;
|
display: block;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
|
max-width: 100%;
|
||||||
|
max-height: 15vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.referenceImagePreview {
|
.referenceImagePreview {
|
||||||
|
@ -108,6 +108,11 @@ const MarkdownContent = ({
|
|||||||
const fileThumbnail = documentId ? fileThumbnails[documentId] : '';
|
const fileThumbnail = documentId ? fileThumbnails[documentId] : '';
|
||||||
const fileExtension = documentId ? getExtension(document?.doc_name) : '';
|
const fileExtension = documentId ? getExtension(document?.doc_name) : '';
|
||||||
const imageId = chunkItem?.image_id;
|
const imageId = chunkItem?.image_id;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Image id={imageId} className={styles.referenceChunkImage}></Image>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={chunkItem?.id} className="flex gap-2">
|
<div key={chunkItem?.id} className="flex gap-2">
|
||||||
{imageId && (
|
{imageId && (
|
||||||
@ -172,6 +177,7 @@ const MarkdownContent = ({
|
|||||||
(text: string) => {
|
(text: string) => {
|
||||||
let replacedText = reactStringReplace(text, reg, (match, i) => {
|
let replacedText = reactStringReplace(text, reg, (match, i) => {
|
||||||
const chunkIndex = getChunkIndex(match);
|
const chunkIndex = getChunkIndex(match);
|
||||||
|
return getPopoverContent(chunkIndex);
|
||||||
return (
|
return (
|
||||||
<Popover content={getPopoverContent(chunkIndex)} key={i}>
|
<Popover content={getPopoverContent(chunkIndex)} key={i}>
|
||||||
<InfoCircleOutlined className={styles.referenceIcon} />
|
<InfoCircleOutlined className={styles.referenceIcon} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user