Fix: Remove antd from dataset-page (#8830)

### What problem does this PR solve?

remove antd from dataset-page
[#3221](https://github.com/infiniflow/ragflow/issues/3221)
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-07-15 16:12:50 +08:00
committed by GitHub
parent 148fde8b1b
commit ed8d7291ff
27 changed files with 916 additions and 460 deletions

View File

@ -1,15 +0,0 @@
.primitiveImg {
display: inline-block;
max-height: 100px;
}
.image {
max-width: 100px;
object-fit: contain;
}
.imagePreview {
display: block;
max-width: 45vw;
max-height: 40vh;
}

View File

@ -1,8 +1,6 @@
import { api_host } from '@/utils/api';
import { Popover } from 'antd';
import classNames from 'classnames';
import styles from './index.less';
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
interface IImage {
id: string;
@ -16,7 +14,7 @@ const Image = ({ id, className, ...props }: IImage) => {
{...props}
src={`${api_host}/document/image/${id}`}
alt=""
className={classNames(styles.primitiveImg, className)}
className={classNames('max-w-[45vw] max-h-[40wh] block', className)}
/>
);
};
@ -25,11 +23,13 @@ export default Image;
export const ImageWithPopover = ({ id }: { id: string }) => {
return (
<Popover
placement="left"
content={<Image id={id} className={styles.imagePreview}></Image>}
>
<Image id={id} className={styles.image}></Image>
<Popover>
<PopoverTrigger>
<Image id={id} className="max-h-[100px] inline-block"></Image>
</PopoverTrigger>
<PopoverContent>
<Image id={id} className="max-w-[100px] object-contain"></Image>
</PopoverContent>
</Popover>
);
};