2025-04-25 17:24:47 +08:00
|
|
|
import type { FC } from 'react'
|
|
|
|
import { memo } from 'react'
|
2025-05-19 18:08:27 +08:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2025-04-25 17:24:47 +08:00
|
|
|
import type { KnowledgeBaseNodeType } from './types'
|
2025-05-26 16:33:08 +08:00
|
|
|
import { useSettingsDisplay } from './hooks/use-settings-display'
|
2025-04-25 17:24:47 +08:00
|
|
|
import type { NodeProps } from '@/app/components/workflow/types'
|
2025-05-07 15:08:13 +08:00
|
|
|
|
|
|
|
const Node: FC<NodeProps<KnowledgeBaseNodeType>> = ({ data }) => {
|
2025-05-19 18:08:27 +08:00
|
|
|
const { t } = useTranslation()
|
2025-05-26 16:33:08 +08:00
|
|
|
const settingsDisplay = useSettingsDisplay()
|
|
|
|
|
2025-04-25 17:24:47 +08:00
|
|
|
return (
|
2025-05-07 15:08:13 +08:00
|
|
|
<div className='mb-1 space-y-0.5 px-3 py-1'>
|
|
|
|
<div className='flex h-6 items-center rounded-md bg-workflow-block-parma-bg px-1.5'>
|
2025-05-19 18:08:27 +08:00
|
|
|
<div className='system-xs-medium-uppercase mr-2 shrink-0 text-text-tertiary'>{t('datasetCreation.stepTwo.indexMode')}</div>
|
2025-05-26 16:33:08 +08:00
|
|
|
<div className='system-xs-medium grow truncate text-right text-text-secondary' title={data.indexing_technique}>{settingsDisplay[data.indexing_technique]}</div>
|
2025-05-07 15:08:13 +08:00
|
|
|
</div>
|
|
|
|
<div className='flex h-6 items-center rounded-md bg-workflow-block-parma-bg px-1.5'>
|
2025-05-19 18:08:27 +08:00
|
|
|
<div className='system-xs-medium-uppercase mr-2 shrink-0 text-text-tertiary'>{t('datasetSettings.form.retrievalSetting.title')}</div>
|
2025-05-26 16:33:08 +08:00
|
|
|
<div className='system-xs-medium grow truncate text-right text-text-secondary' title={data.retrieval_model.search_method}>{(settingsDisplay as Record<string, string>)[data.retrieval_model.search_method]}</div>
|
2025-05-07 15:08:13 +08:00
|
|
|
</div>
|
2025-04-25 17:24:47 +08:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(Node)
|