mirror of
https://github.com/langgenius/dify.git
synced 2026-03-29 00:10:33 +08: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>
27 lines
703 B
TypeScript
27 lines
703 B
TypeScript
'use client'
|
|
import React from 'react'
|
|
import { useContext } from 'use-context-selector'
|
|
import Select from '@/app/components/base/select/locale'
|
|
import { languages } from '@/i18n/language'
|
|
import type { Locale } from '@/i18n'
|
|
import I18n from '@/context/i18n'
|
|
import LogoSite from '@/app/components/base/logo/logo-site'
|
|
|
|
const Header = () => {
|
|
const { locale, setLocaleOnClient } = useContext(I18n)
|
|
|
|
return <div className='flex w-full items-center justify-between p-6'>
|
|
<LogoSite />
|
|
<Select
|
|
value={locale}
|
|
items={languages.filter(item => item.supported)}
|
|
onChange={(value) => {
|
|
setLocaleOnClient(value as Locale)
|
|
}}
|
|
/>
|
|
|
|
</div>
|
|
}
|
|
|
|
export default Header
|