Feat: Show images in reply messages #7608 (#7625)

### 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:
balibabu 2025-05-13 19:30:17 +08:00 committed by GitHub
parent 01330fa428
commit fe3b2acde0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -17,8 +17,10 @@
}
.referenceChunkImage {
width: 10vw;
display: block;
object-fit: contain;
max-width: 100%;
max-height: 15vh;
}
.referenceImagePreview {

View File

@ -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} />