mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-29 17:45:12 +08:00

Co-authored-by: NFish <douxc512@gmail.com> Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: jZonG <jzongcode@gmail.com>
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
'use client'
|
|
import type { FC } from 'react'
|
|
import React from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import { SegmentIndexTag } from '../../documents/detail/completed/common/segment-index-tag'
|
|
import Dot from '../../documents/detail/completed/common/dot'
|
|
import Score from './score'
|
|
import cn from '@/utils/classnames'
|
|
|
|
type Props = {
|
|
labelPrefix: string
|
|
positionId: number
|
|
wordCount: number
|
|
score: number
|
|
className?: string
|
|
}
|
|
|
|
const ResultItemMeta: FC<Props> = ({
|
|
labelPrefix,
|
|
positionId,
|
|
wordCount,
|
|
score,
|
|
className,
|
|
}) => {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<div className={cn('flex items-center justify-between', className)}>
|
|
<div className="flex items-center space-x-2">
|
|
<SegmentIndexTag
|
|
labelPrefix={labelPrefix}
|
|
positionId={positionId}
|
|
className={cn('w-fit group-hover:opacity-100')}
|
|
/>
|
|
<Dot />
|
|
<div className="system-xs-medium text-text-tertiary">
|
|
{wordCount} {t('datasetDocuments.segment.characters', { count: wordCount })}
|
|
</div>
|
|
</div>
|
|
<Score value={score} />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default React.memo(ResultItemMeta)
|