Files
dify/web/app/components/base/prompt-editor/plugins/query-block/component.tsx
FFXN 83743d5af0 feat: evaluation (#35419)
Co-authored-by: jyong <718720800@qq.com>
Co-authored-by: Yansong Zhang <916125788@qq.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: hj24 <mambahj24@gmail.com>
Co-authored-by: hj24 <huangjian@dify.ai>
Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: Stephen Zhou <38493346+hyoban@users.noreply.github.com>
Co-authored-by: CodingOnStar <hanxujiang@dify.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-04-20 15:43:22 +08:00

34 lines
1.1 KiB
TypeScript

import type { FC } from 'react'
import { useTranslation } from 'react-i18next'
import { UserEdit02 } from '@/app/components/base/icons/src/vender/solid/users'
import { useSelectOrDelete } from '../../hooks'
import { DELETE_QUERY_BLOCK_COMMAND } from './index'
type QueryBlockComponentProps = {
nodeKey: string
}
const QueryBlockComponent: FC<QueryBlockComponentProps> = ({
nodeKey,
}) => {
const { t } = useTranslation()
const [ref, isSelected] = useSelectOrDelete(nodeKey, DELETE_QUERY_BLOCK_COMMAND)
return (
<div
className={`
inline-flex h-6 items-center rounded-[5px] border border-transparent bg-[#FFF6ED] pl-1 pr-0.5 hover:bg-[#FFEAD5]
${isSelected && 'border-[#FD853A]!'}
`}
ref={ref}
>
<UserEdit02 className="mr-1 h-[14px] w-[14px] text-[#FD853A]" />
<div className="text-xs font-medium text-[#EC4A0A] opacity-60">{'{{'}</div>
<div className="text-xs font-medium text-[#EC4A0A]">{t('promptEditor.query.item.title', { ns: 'common' })}</div>
<div className="text-xs font-medium text-[#EC4A0A] opacity-60">{'}}'}</div>
</div>
)
}
export default QueryBlockComponent