dify/web/app/components/datasets/documents/create-from-pipeline/processing/index.tsx
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

65 lines
2.5 KiB
TypeScript

'use client'
import type { InitialDocumentDetail } from '@/models/pipeline'
import { RiBookOpenLine } from '@remixicon/react'
import * as React from 'react'
import { useTranslation } from 'react-i18next'
import { useDatasetDetailContextWithSelector } from '@/context/dataset-detail'
import { useDocLink } from '@/context/i18n'
import EmbeddingProcess from './embedding-process'
type ProcessingProps = {
batchId: string
documents: InitialDocumentDetail[]
}
const Processing = ({ batchId, documents }: ProcessingProps) => {
const { t } = useTranslation()
const docLink = useDocLink()
const datasetId = useDatasetDetailContextWithSelector((s) => s.dataset?.id)
const indexingType = useDatasetDetailContextWithSelector((s) => s.dataset?.indexing_technique)
const retrievalMethod = useDatasetDetailContextWithSelector(
(s) => s.dataset?.retrieval_model_dict?.search_method,
)
return (
<div className="flex size-full justify-center overflow-hidden">
<div className="h-full w-3/5 overflow-y-auto pt-10 pb-8">
<div className="max-w-[640px]">
<EmbeddingProcess
datasetId={datasetId!}
batchId={batchId}
documents={documents}
indexingType={indexingType}
retrievalMethod={retrievalMethod}
/>
</div>
</div>
<div className="w-2/5 pt-[88px] pr-8">
<div className="flex w-[328px] flex-col gap-3 rounded-xl bg-background-section p-6">
<div className="flex size-10 items-center justify-center rounded-[10px] bg-components-card-bg shadow-lg shadow-shadow-shadow-5">
<RiBookOpenLine className="size-5 text-text-accent" />
</div>
<div className="flex flex-col gap-y-2">
<div className="system-xl-semibold text-text-secondary">
{t(($) => $['stepThree.sideTipTitle'], { ns: 'datasetCreation' })}
</div>
<div className="system-sm-regular text-text-tertiary">
{t(($) => $['stepThree.sideTipContent'], { ns: 'datasetCreation' })}
</div>
<a
href={docLink('/use-dify/knowledge/knowledge-pipeline/authorize-data-source')}
target="_blank"
rel="noreferrer noopener"
className="system-sm-regular text-text-accent"
>
{t(($) => $['addDocuments.stepThree.learnMore'], { ns: 'datasetPipeline' })}
</a>
</div>
</div>
</div>
</div>
)
}
export default Processing