mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-31 02:42:59 +00:00 
			
		
		
		
	 7709d9df20
			
		
	
	
		7709d9df20
		
			
		
	
	
	
	
		
			
			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>
		
			
				
	
	
		
			34 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import type { FC } from 'react'
 | |
| import { useTranslation } from 'react-i18next'
 | |
| import { useSelectOrDelete } from '../../hooks'
 | |
| import { DELETE_QUERY_BLOCK_COMMAND } from './index'
 | |
| import { UserEdit02 } from '@/app/components/base/icons/src/vender/solid/users'
 | |
| 
 | |
| 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('common.promptEditor.query.item.title')}</div>
 | |
|       <div className='text-xs font-medium text-[#EC4A0A] opacity-60'>{'}}'}</div>
 | |
|     </div>
 | |
|   )
 | |
| }
 | |
| 
 | |
| export default QueryBlockComponent
 |