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.

node.tsx 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import type { FC } from 'react'
  2. import { memo } from 'react'
  3. import { useTranslation } from 'react-i18next'
  4. import type { KnowledgeBaseNodeType } from './types'
  5. import { useSettingsDisplay } from './hooks/use-settings-display'
  6. import type { NodeProps } from '@/app/components/workflow/types'
  7. const Node: FC<NodeProps<KnowledgeBaseNodeType>> = ({ data }) => {
  8. const { t } = useTranslation()
  9. const settingsDisplay = useSettingsDisplay()
  10. return (
  11. <div className='mb-1 space-y-0.5 px-3 py-1'>
  12. <div className='flex h-6 items-center rounded-md bg-workflow-block-parma-bg px-1.5'>
  13. <div className='system-xs-medium-uppercase mr-2 shrink-0 text-text-tertiary'>
  14. {t('datasetCreation.stepTwo.indexMode')}
  15. </div>
  16. <div
  17. className='system-xs-medium grow truncate text-right text-text-secondary'
  18. title={data.indexing_technique}
  19. >
  20. {settingsDisplay[data.indexing_technique as keyof typeof settingsDisplay]}
  21. </div>
  22. </div>
  23. <div className='flex h-6 items-center rounded-md bg-workflow-block-parma-bg px-1.5'>
  24. <div className='system-xs-medium-uppercase mr-2 shrink-0 text-text-tertiary'>
  25. {t('datasetSettings.form.retrievalSetting.title')}
  26. </div>
  27. <div
  28. className='system-xs-medium grow truncate text-right text-text-secondary'
  29. title={data.retrieval_model.search_method}
  30. >
  31. {settingsDisplay[data.retrieval_model.search_method as keyof typeof settingsDisplay]}
  32. </div>
  33. </div>
  34. </div>
  35. )
  36. }
  37. export default memo(Node)