2025-01-22 19:43:27 +08:00
|
|
|
import { Form, Switch } from 'antd';
|
|
|
|
|
import { useTranslation } from 'react-i18next';
|
2025-02-11 19:04:10 +08:00
|
|
|
import { SwitchFormField } from './switch-fom-field';
|
2025-01-22 19:43:27 +08:00
|
|
|
|
|
|
|
|
type IProps = {
|
2025-03-12 18:47:22 +08:00
|
|
|
filedName: string[] | string;
|
2025-01-22 19:43:27 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function UseKnowledgeGraphItem({ filedName }: IProps) {
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Form.Item
|
|
|
|
|
label={t('chat.useKnowledgeGraph')}
|
|
|
|
|
tooltip={t('chat.useKnowledgeGraphTip')}
|
|
|
|
|
name={filedName}
|
|
|
|
|
initialValue={false}
|
|
|
|
|
>
|
|
|
|
|
<Switch></Switch>
|
|
|
|
|
</Form.Item>
|
|
|
|
|
);
|
|
|
|
|
}
|
2025-02-11 19:04:10 +08:00
|
|
|
|
|
|
|
|
interface UseKnowledgeGraphFormFieldProps {
|
|
|
|
|
name: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function UseKnowledgeGraphFormField({
|
|
|
|
|
name,
|
|
|
|
|
}: UseKnowledgeGraphFormFieldProps) {
|
|
|
|
|
const { t } = useTranslation();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<SwitchFormField
|
|
|
|
|
name={name}
|
|
|
|
|
label={t('chat.useKnowledgeGraph')}
|
2025-04-17 19:03:55 +08:00
|
|
|
tooltip={t('chat.useKnowledgeGraphTip')}
|
2025-02-11 19:04:10 +08:00
|
|
|
></SwitchFormField>
|
|
|
|
|
);
|
|
|
|
|
}
|