mirror of
https://github.com/langgenius/dify.git
synced 2026-04-10 03:33:37 +08:00
Co-authored-by: CodingOnStar <hanxujiang@dify.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
33 lines
793 B
TypeScript
33 lines
793 B
TypeScript
import type { FC } from 'react'
|
|
import * as React from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
type SegmentProgressProps = {
|
|
completedSegments?: number
|
|
totalSegments?: number
|
|
percent: number
|
|
}
|
|
|
|
const SegmentProgress: FC<SegmentProgressProps> = React.memo(({
|
|
completedSegments,
|
|
totalSegments,
|
|
percent,
|
|
}) => {
|
|
const { t } = useTranslation()
|
|
|
|
const completed = completedSegments ?? '--'
|
|
const total = totalSegments ?? '--'
|
|
|
|
return (
|
|
<div className="flex w-full items-center">
|
|
<span className="system-xs-medium text-text-secondary">
|
|
{`${t('embedding.segments', { ns: 'datasetDocuments' })} ${completed}/${total} · ${percent}%`}
|
|
</span>
|
|
</div>
|
|
)
|
|
})
|
|
|
|
SegmentProgress.displayName = 'SegmentProgress'
|
|
|
|
export default SegmentProgress
|