index.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. 'use client'
  2. import type { FC } from 'react'
  3. import React from 'react'
  4. import { useTranslation } from 'react-i18next'
  5. import RetrievalParamConfig from '../retrieval-param-config'
  6. import { RETRIEVE_METHOD } from '@/types/app'
  7. import RadioCard from '@/app/components/base/radio-card'
  8. import { HighPriority } from '@/app/components/base/icons/src/vender/solid/arrows'
  9. import type { RetrievalConfig } from '@/types/app'
  10. type Props = {
  11. value: RetrievalConfig
  12. onChange: (value: RetrievalConfig) => void
  13. }
  14. const EconomicalRetrievalMethodConfig: FC<Props> = ({
  15. value,
  16. onChange,
  17. }) => {
  18. const { t } = useTranslation()
  19. return (
  20. <div className='space-y-2'>
  21. <RadioCard
  22. icon={<HighPriority className='w-4 h-4 text-[#7839EE]' />}
  23. title={t('dataset.retrieval.invertedIndex.title')}
  24. description={t('dataset.retrieval.invertedIndex.description')}
  25. noRadio
  26. chosenConfig={
  27. <RetrievalParamConfig
  28. type={RETRIEVE_METHOD.invertedIndex}
  29. value={value}
  30. onChange={onChange}
  31. />
  32. }
  33. />
  34. </div>
  35. )
  36. }
  37. export default React.memo(EconomicalRetrievalMethodConfig)