mirror of
https://github.com/langgenius/dify.git
synced 2025-11-02 20:03:09 +00:00
48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
'use client'
|
|
import type { FC } from 'react'
|
|
import React from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import RetrievalParamConfig from '../retrieval-param-config'
|
|
import { RETRIEVE_METHOD } from '@/types/app'
|
|
import type { RetrievalConfig } from '@/types/app'
|
|
import OptionCard from '../../settings/option-card'
|
|
import { VectorSearch } from '@/app/components/base/icons/src/vender/knowledge'
|
|
import { EffectColor } from '../../settings/chunk-structure/types'
|
|
|
|
type Props = {
|
|
disabled?: boolean
|
|
value: RetrievalConfig
|
|
onChange: (value: RetrievalConfig) => void
|
|
}
|
|
|
|
const EconomicalRetrievalMethodConfig: FC<Props> = ({
|
|
disabled = false,
|
|
value,
|
|
onChange,
|
|
}) => {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<OptionCard
|
|
id={RETRIEVE_METHOD.invertedIndex}
|
|
disabled={disabled}
|
|
icon={<VectorSearch className='size-4' />}
|
|
iconActiveColor='text-util-colors-purple-purple-600'
|
|
title={t('dataset.retrieval.invertedIndex.title')}
|
|
description={t('dataset.retrieval.invertedIndex.description')}
|
|
isActive
|
|
effectColor={EffectColor.purple}
|
|
showEffectColor
|
|
showChildren
|
|
className='gap-x-2'
|
|
>
|
|
<RetrievalParamConfig
|
|
type={RETRIEVE_METHOD.invertedIndex}
|
|
value={value}
|
|
onChange={onChange}
|
|
/>
|
|
</OptionCard>
|
|
)
|
|
}
|
|
export default React.memo(EconomicalRetrievalMethodConfig)
|