mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-15 22:06:52 +08:00
Signed-off-by: -LAN- <laipz8200@outlook.com> Co-authored-by: -LAN- <laipz8200@outlook.com>
31 lines
1001 B
TypeScript
31 lines
1001 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' : ''}
|
|
>
|
|
<div className='inline-flex items-center relative top-[-2px]'>
|
|
<div className='flex items-center h-[20.5px] bg-state-accent-solid system-2xs-semibold-uppercase text-text-primary-on-surface px-1'>C-{position}</div>
|
|
<Score value={score} besideChunkName />
|
|
</div>
|
|
<SliceContent className='py-0.5 bg-state-accent-hover group-hover:bg-state-accent-hover text-sm text-text-secondary font-normal'>{content}</SliceContent>
|
|
</div>
|
|
)
|
|
}
|
|
export default React.memo(ChildChunks)
|