mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-15 18:55:55 +08:00
fix: rendering errors occur when displaying hit test results in full text search (#12191)
This commit is contained in:
parent
bd2fec4813
commit
716bb8574d
@ -4,7 +4,7 @@ import React from 'react'
|
|||||||
import cn from '@/utils/classnames'
|
import cn from '@/utils/classnames'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
value: number
|
value: number | null
|
||||||
besideChunkName?: boolean
|
besideChunkName?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,6 +12,9 @@ const Score: FC<Props> = ({
|
|||||||
value,
|
value,
|
||||||
besideChunkName,
|
besideChunkName,
|
||||||
}) => {
|
}) => {
|
||||||
|
if (!value)
|
||||||
|
return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn('relative items-center px-[5px] border border-components-progress-bar-border overflow-hidden', besideChunkName ? 'border-l-0 h-[20.5px]' : 'h-[20px] rounded-md')}>
|
<div className={cn('relative items-center px-[5px] border border-components-progress-bar-border overflow-hidden', besideChunkName ? 'border-l-0 h-[20.5px]' : 'h-[20px] rounded-md')}>
|
||||||
<div className={cn('absolute top-0 left-0 h-full bg-util-colors-blue-brand-blue-brand-100 border-r-[1.5px] border-components-progress-brand-progress', value === 1 && 'border-r-0')} style={{ width: `${value * 100}%` }} />
|
<div className={cn('absolute top-0 left-0 h-full bg-util-colors-blue-brand-blue-brand-100 border-r-[1.5px] border-components-progress-brand-progress', value === 1 && 'border-r-0')} style={{ width: `${value * 100}%` }} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user