You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rag-tool-suggestions.tsx 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import type { Dispatch, SetStateAction } from 'react'
  2. import React, { useCallback } from 'react'
  3. import { useTranslation } from 'react-i18next'
  4. import type { OnSelectBlock, ToolWithProvider } from '../types'
  5. // import Tools from './tools'
  6. // import { ToolTypeEnum } from './types'
  7. import type { ViewType } from './view-type-select'
  8. import { RiMoreLine } from '@remixicon/react'
  9. type RAGToolSuggestionsProps = {
  10. tools: ToolWithProvider[]
  11. viewType: ViewType
  12. onSelect: OnSelectBlock
  13. onTagsChange: Dispatch<SetStateAction<string[]>>
  14. }
  15. const RAGToolSuggestions: React.FC<RAGToolSuggestionsProps> = ({
  16. // tools,
  17. // viewType,
  18. // onSelect,
  19. onTagsChange,
  20. }) => {
  21. const { t } = useTranslation()
  22. const loadMore = useCallback(() => {
  23. onTagsChange(prev => [...prev, 'rag'])
  24. }, [onTagsChange])
  25. return (
  26. <div className='flex flex-col p-1'>
  27. <div className='system-xs-medium px-3 pb-0.5 pt-1 text-text-tertiary'>
  28. {t('pipeline.ragToolSuggestions.title')}
  29. </div>
  30. {/* <Tools
  31. className='p-0'
  32. tools={tools}
  33. onSelect={onSelect}
  34. canNotSelectMultiple
  35. toolType={ToolTypeEnum.All}
  36. viewType={viewType}
  37. hasSearchText={false}
  38. /> */}
  39. <div
  40. className='flex cursor-pointer items-center gap-x-2 py-1 pl-3 pr-2'
  41. onClick={loadMore}
  42. >
  43. <div className='px-1'>
  44. <RiMoreLine className='size-4 text-text-tertiary' />
  45. </div>
  46. <div className='system-xs-regular text-text-tertiary'>
  47. {t('common.operation.more')}
  48. </div>
  49. </div>
  50. </div>
  51. )
  52. }
  53. export default React.memo(RAGToolSuggestions)