Files
dify/web/app/device/_header.tsx
Yunlu Wen a728e0ac69 feat: adding dify cli (#36348)
Co-authored-by: GareArc <garethcxy@dify.ai>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: L1nSn0w <l1nsn0w@qq.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: gigglewang <gigglewang@dify.ai>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Xiyuan Chen <52963600+GareArc@users.noreply.github.com>
2026-05-26 01:12:36 +00:00

51 lines
1.6 KiB
TypeScript

'use client'
import { useSuspenseQuery } from '@tanstack/react-query'
import Divider from '@/app/components/base/divider'
import LocaleMenu from '@/app/signin/_locale-menu'
import { useLocale } from '@/context/i18n'
import { setLocaleOnClient } from '@/i18n-config'
import { languages } from '@/i18n-config/language'
import dynamic from '@/next/dynamic'
import { systemFeaturesQueryOptions } from '@/service/system-features'
const DifyLogo = dynamic(() => import('@/app/components/base/logo/dify-logo'), {
ssr: false,
loading: () => <div className="h-7 w-16 bg-transparent" />,
})
const ThemeSelector = dynamic(() => import('@/app/components/base/theme-selector'), {
ssr: false,
loading: () => <div className="size-8 bg-transparent" />,
})
const Header = () => {
const locale = useLocale()
const { data: systemFeatures } = useSuspenseQuery(systemFeaturesQueryOptions())
return (
<div className="flex w-full items-center justify-between p-6">
{systemFeatures.branding.enabled && systemFeatures.branding.login_page_logo
? (
<img
src={systemFeatures.branding.login_page_logo}
className="block h-7 w-auto object-contain"
alt="logo"
/>
)
: <DifyLogo size="large" />}
<div className="flex items-center gap-1">
<LocaleMenu
value={locale}
items={languages.filter(item => item.supported)}
onChange={(value) => {
setLocaleOnClient(value, false)
}}
/>
<Divider type="vertical" className="mx-0 ml-2 h-4" />
<ThemeSelector />
</div>
</div>
)
}
export default Header