| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | 'use client' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import React, { useState } from 'react' | 
					
						
							|  |  |  | import { useTranslation } from 'react-i18next' | 
					
						
							|  |  |  | import { ArrowLeftIcon, Squares2X2Icon } from '@heroicons/react/24/solid' | 
					
						
							| 
									
										
										
										
											2024-07-09 15:05:40 +08:00
										 |  |  | import classNames from '@/utils/classnames' | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  | 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) | 
					
						
							| 
									
										
										
										
											2025-03-21 17:41:03 +08:00
										 |  |  |           ? <ArrowLeftIcon className='mr-1 h-[18px] w-[18px]' /> | 
					
						
							|  |  |  |           : <Squares2X2Icon className='mr-1 h-[18px] w-[18px]' /> | 
					
						
							| 
									
										
										
										
											2023-05-15 08:51:32 +08:00
										 |  |  |       } | 
					
						
							|  |  |  |       {t('common.menus.apps')} | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   ) | 
					
						
							|  |  |  | } |