dify/web/app/components/datasets/documents/detail/embedding/components/segment-progress.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

31 lines
823 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