mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-23 23:16:58 +08:00
### What problem does this PR solve? feat: Add hint for operators, round to square, input variable, readable operator ID. #3056 ### Type of change - [ ] Bug Fix (non-breaking change which fixes an issue) - [x] New Feature (non-breaking change which adds functionality) - [ ] Documentation Update - [ ] Refactoring - [ ] Performance Improvement - [ ] Other (please describe):
44 lines
1.0 KiB
TypeScript
44 lines
1.0 KiB
TypeScript
import { useTranslate } from '@/hooks/common-hooks';
|
|
import { useNextFetchKnowledgeList } from '@/hooks/knowledge-hooks';
|
|
import { UserOutlined } from '@ant-design/icons';
|
|
import { Avatar, Form, Select, Space } from 'antd';
|
|
|
|
const KnowledgeBaseItem = () => {
|
|
const { t } = useTranslate('chat');
|
|
|
|
const { list: knowledgeList } = useNextFetchKnowledgeList(true);
|
|
|
|
const knowledgeOptions = knowledgeList.map((x) => ({
|
|
label: (
|
|
<Space>
|
|
<Avatar size={20} icon={<UserOutlined />} src={x.avatar} />
|
|
{x.name}
|
|
</Space>
|
|
),
|
|
value: x.id,
|
|
}));
|
|
|
|
return (
|
|
<Form.Item
|
|
label={t('knowledgeBases')}
|
|
name="kb_ids"
|
|
tooltip={t('knowledgeBasesTip')}
|
|
rules={[
|
|
{
|
|
required: true,
|
|
message: t('knowledgeBasesMessage'),
|
|
type: 'array',
|
|
},
|
|
]}
|
|
>
|
|
<Select
|
|
mode="multiple"
|
|
options={knowledgeOptions}
|
|
placeholder={t('knowledgeBasesMessage')}
|
|
></Select>
|
|
</Form.Item>
|
|
);
|
|
};
|
|
|
|
export default KnowledgeBaseItem;
|