mirror of
				https://github.com/langgenius/dify.git
				synced 2025-10-31 19:03:09 +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
		
	
	
		
			831 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			831 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { memo } from 'react'
 | |
| import ShortcutsName from '../shortcuts-name'
 | |
| import Tooltip from '@/app/components/base/tooltip'
 | |
| 
 | |
| type TipPopupProps = {
 | |
|   title: string
 | |
|   children: React.ReactNode
 | |
|   shortcuts?: string[]
 | |
| }
 | |
| const TipPopup = ({
 | |
|   title,
 | |
|   children,
 | |
|   shortcuts,
 | |
| }: TipPopupProps) => {
 | |
|   return (
 | |
|     <Tooltip
 | |
|       offset={4}
 | |
|       popupClassName='p-0 bg-transparent'
 | |
|       popupContent={
 | |
|         <div className='flex items-center gap-1 rounded-lg border-[0.5px] border-components-panel-border bg-components-tooltip-bg p-1.5 shadow-lg backdrop-blur-[5px]'>
 | |
|           <span className='system-xs-medium text-text-secondary'>{title}</span>
 | |
|           {
 | |
|             shortcuts && <ShortcutsName keys={shortcuts} />
 | |
|           }
 | |
|         </div>
 | |
|       }
 | |
|     >
 | |
|       {children}
 | |
|     </Tooltip>
 | |
|   )
 | |
| }
 | |
| 
 | |
| export default memo(TipPopup)
 |