Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

1.1 KB
Raw Blame
'use client'
import type { FC } from 'react'
import { cn } from '@langgenius/dify-ui/cn'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import Badge from '@/app/components/base/badge'

type Props = Readonly<{
  isGeneralMode: boolean
  isQAMode: boolean
}>

const ChunkingModeLabel: FC<Props> = ({ isGeneralMode, isQAMode }) => {
  const { t } = useTranslation(['dataset'])
  const iconClassName = isGeneralMode
    ? 'i-custom-vender-knowledge-general-chunk'
    : 'i-custom-vender-knowledge-parent-child-chunk'
  const generalSuffix = isQAMode ? ' · QA' : ''

  return (
    <Badge>
      <div className="flex h-full items-center space-x-0.5 text-text-tertiary">
        <span aria-hidden className={cn(iconClassName, 'size-3')} />
        <span className="system-2xs-medium-uppercase">
          {isGeneralMode
            ? `${t(($) => $['chunkingMode.general'], { ns: 'dataset' })}${generalSuffix}`
            : t(($) => $['chunkingMode.parentChild'], { ns: 'dataset' })}
        </span>
      </div>
    </Badge>
  )
}
export default React.memo(ChunkingModeLabel)