You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/web/app/components/datasets/hit-testing/components/child-chunks-item.tsx

31 lines
1011 B
TypeScript

'use client'
import type { FC } from 'react'
import React from 'react'
import { SliceContent } from '../../formatted-text/flavours/shared'
import Score from './score'
import type { HitTestingChildChunk } from '@/models/datasets'
type Props = {
payload: HitTestingChildChunk
isShowAll: boolean
}
const ChildChunks: FC<Props> = ({
payload,
isShowAll,
}) => {
const { id, score, content, position } = payload
return (
<div
className={!isShowAll ? 'line-clamp-2 break-all' : ''}
>
<div className='relative top-[-2px] inline-flex items-center'>
<div className='bg-state-accent-solid system-2xs-semibold-uppercase text-text-primary-on-surface flex h-[20.5px] items-center px-1'>C-{position}</div>
<Score value={score} besideChunkName />
</div>
<SliceContent className='bg-state-accent-hover group-hover:bg-state-accent-hover text-text-secondary py-0.5 text-sm font-normal'>{content}</SliceContent>
</div>
)
}
export default React.memo(ChildChunks)