dify/web/app/components/header/app-back/index.tsx
Stephen Zhou 6d0e36479b
refactor(i18n): use JSON with flattened key and namespace (#30114)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-12-29 14:52:32 +08:00

38 lines
1.0 KiB
TypeScript

'use client'
import type { AppDetailResponse } from '@/models/app'
import { ArrowLeftIcon, Squares2X2Icon } from '@heroicons/react/24/solid'
import * as React from 'react'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { cn } from '@/utils/classnames'
type IAppBackProps = {
curApp: AppDetailResponse
}
export default function AppBack({ curApp }: IAppBackProps) {
const { t } = useTranslation()
const [hovered, setHovered] = useState(false)
return (
<div
className={cn(`
flex h-7 cursor-pointer items-center rounded-[10px]
pl-2.5 pr-2 font-semibold
text-[#1C64F2]
${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('menus.apps', { ns: 'common' })}
</div>
)
}