'use client' import type { FC } from 'react' import React, { useRef, useState } from 'react' import { useClickAway } from 'ahooks' import { useTranslation } from 'react-i18next' import { XClose } from '@/app/components/base/icons/src/vender/line/general' import type { RetrievalConfig } from '@/types/app' import RetrievalMethodConfig from '@/app/components/datasets/common/retrieval-method-config' import EconomicalRetrievalMethodConfig from '@/app/components/datasets/common/economical-retrieval-method-config' import Button from '@/app/components/base/button' type Props = { indexMethod: string value: RetrievalConfig isShow: boolean onHide: () => void onSave: (value: RetrievalConfig) => void } const ModifyRetrievalModal: FC = ({ indexMethod, value, isShow, onHide, onSave, }) => { const ref = useRef(null) const { t } = useTranslation() const [retrievalConfig, setRetrievalConfig] = useState(value) useClickAway(() => { if (ref) onHide() }, ref) if (!isShow) return null return (
{t('datasetSettings.form.retrievalSetting.title')}
{t('datasetSettings.form.retrievalSetting.learnMore')} {t('datasetSettings.form.retrievalSetting.description')}
{indexMethod === 'high_quality' ? ( ) : ( )}
) } export default React.memo(ModifyRetrievalModal)