feat: transform the parser's data structure and add Image to TestingResult (#63)

* feat: add Image to TestingResult

* feat: transform the parser's data structure
This commit is contained in:
balibabu
2024-02-08 18:50:11 +08:00
committed by GitHub
parent 1a156e6569
commit 53be70c7a9
5 changed files with 75 additions and 34 deletions

View File

@ -1,7 +1,7 @@
import Image from '@/components/image';
import { IChunk } from '@/interfaces/database/knowledge';
import { api_host } from '@/utils/api';
import { Card, Checkbox, CheckboxProps, Flex, Popover, Switch } from 'antd';
import { useState } from 'react';
import styles from './index.less';
@ -13,22 +13,6 @@ interface IProps {
handleCheckboxClick: (chunkId: string, checked: boolean) => void;
}
interface IImage {
id: string;
className: string;
}
// Pass onMouseEnter and onMouseLeave to img tag using props
const Image = ({ id, className, ...props }: IImage) => {
return (
<img
{...props}
src={`${api_host}/document/image/${id}`}
alt=""
className={className}
/>
);
};
const ChunkCard = ({
item,
checked,