mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-07-04 04:35:14 +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 {
|
||||
width: 10vw;
|
||||
display: block;
|
||||
object-fit: contain;
|
||||
max-width: 100%;
|
||||
max-height: 15vh;
|
||||
}
|
||||
|
||||
.referenceImagePreview {
|
||||
|
@ -108,6 +108,11 @@ const MarkdownContent = ({
|
||||
const fileThumbnail = documentId ? fileThumbnails[documentId] : '';
|
||||
const fileExtension = documentId ? getExtension(document?.doc_name) : '';
|
||||
const imageId = chunkItem?.image_id;
|
||||
|
||||
return (
|
||||
<Image id={imageId} className={styles.referenceChunkImage}></Image>
|
||||
);
|
||||
|
||||
return (
|
||||
<div key={chunkItem?.id} className="flex gap-2">
|
||||
{imageId && (
|
||||
@ -172,6 +177,7 @@ const MarkdownContent = ({
|
||||
(text: string) => {
|
||||
let replacedText = reactStringReplace(text, reg, (match, i) => {
|
||||
const chunkIndex = getChunkIndex(match);
|
||||
return getPopoverContent(chunkIndex);
|
||||
return (
|
||||
<Popover content={getPopoverContent(chunkIndex)} key={i}>
|
||||
<InfoCircleOutlined className={styles.referenceIcon} />
|
||||
|
Loading…
x
Reference in New Issue
Block a user