mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: send question with retrieval api #2247 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -1,19 +0,0 @@
|
||||
import { api_host } from '@/utils/api';
|
||||
|
||||
interface IImage {
|
||||
id: string;
|
||||
className: string;
|
||||
}
|
||||
|
||||
const Image = ({ id, className, ...props }: IImage) => {
|
||||
return (
|
||||
<img
|
||||
{...props}
|
||||
src={`${api_host}/document/image/${id}`}
|
||||
alt=""
|
||||
className={className}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default Image;
|
||||
10
web/src/components/image/index.less
Normal file
10
web/src/components/image/index.less
Normal file
@ -0,0 +1,10 @@
|
||||
.image {
|
||||
width: 100px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.imagePreview {
|
||||
display: block;
|
||||
max-width: 45vw;
|
||||
max-height: 40vh;
|
||||
}
|
||||
33
web/src/components/image/index.tsx
Normal file
33
web/src/components/image/index.tsx
Normal file
@ -0,0 +1,33 @@
|
||||
import { api_host } from '@/utils/api';
|
||||
import { Popover } from 'antd';
|
||||
|
||||
import styles from './index.less';
|
||||
|
||||
interface IImage {
|
||||
id: string;
|
||||
className: string;
|
||||
}
|
||||
|
||||
const Image = ({ id, className, ...props }: IImage) => {
|
||||
return (
|
||||
<img
|
||||
{...props}
|
||||
src={`${api_host}/document/image/${id}`}
|
||||
alt=""
|
||||
className={className}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user