2025-05-16 16:12:07 +08:00
|
|
|
import { Popover } from 'antd';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
|
|
import styles from './index.less';
|
|
|
|
|
|
|
|
interface IImage {
|
|
|
|
id: string;
|
|
|
|
className: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ChunkImage = ({ id, className, ...props }: IImage) => {
|
2025-05-16 17:15:33 +08:00
|
|
|
const imgSrc = id;
|
|
|
|
|
2025-05-16 16:12:07 +08:00
|
|
|
return (
|
|
|
|
<img
|
|
|
|
{...props}
|
2025-05-16 17:15:33 +08:00
|
|
|
src={imgSrc}
|
2025-05-16 16:12:07 +08:00
|
|
|
alt=""
|
|
|
|
className={classNames(styles.primitiveImg, className)}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ChunkImage;
|
|
|
|
|
|
|
|
export const ImageWithPopover = ({ id }: { id: string }) => {
|
|
|
|
return (
|
|
|
|
<Popover
|
|
|
|
placement="left"
|
|
|
|
content={
|
|
|
|
<ChunkImage id={id} className={styles.imagePreview}></ChunkImage>
|
|
|
|
}
|
|
|
|
>
|
|
|
|
<ChunkImage id={id} className={styles.image}></ChunkImage>
|
|
|
|
</Popover>
|
|
|
|
);
|
|
|
|
};
|