mirror of
				https://github.com/langgenius/dify.git
				synced 2025-11-04 04:43:09 +00:00 
			
		
		
		
	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>
		
			
				
	
	
		
			37 lines
		
	
	
		
			1008 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1008 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
'use client'
 | 
						|
 | 
						|
import React, { useState } from 'react'
 | 
						|
import { useTranslation } from 'react-i18next'
 | 
						|
import { ArrowLeftIcon, Squares2X2Icon } from '@heroicons/react/24/solid'
 | 
						|
import classNames from '@/utils/classnames'
 | 
						|
import type { AppDetailResponse } from '@/models/app'
 | 
						|
 | 
						|
type IAppBackProps = {
 | 
						|
  curApp: AppDetailResponse
 | 
						|
}
 | 
						|
export default function AppBack({ curApp }: IAppBackProps) {
 | 
						|
  const { t } = useTranslation()
 | 
						|
 | 
						|
  const [hovered, setHovered] = useState(false)
 | 
						|
 | 
						|
  return (
 | 
						|
    <div
 | 
						|
      className={classNames(`
 | 
						|
        flex items-center h-7 pl-2.5 pr-2
 | 
						|
        text-[#1C64F2] font-semibold cursor-pointer
 | 
						|
        rounded-[10px]
 | 
						|
        ${curApp && 'hover:bg-[#EBF5FF]'}
 | 
						|
      `)}
 | 
						|
      onMouseEnter={() => setHovered(true)}
 | 
						|
      onMouseLeave={() => setHovered(false)}
 | 
						|
    >
 | 
						|
      {
 | 
						|
        (hovered && curApp)
 | 
						|
          ? <ArrowLeftIcon className='mr-1 h-[18px] w-[18px]' />
 | 
						|
          : <Squares2X2Icon className='mr-1 h-[18px] w-[18px]' />
 | 
						|
      }
 | 
						|
      {t('common.menus.apps')}
 | 
						|
    </div>
 | 
						|
  )
 | 
						|
}
 |