feat: Use Romanian & other langs in QA (#4205)

Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
rennokki
2024-05-14 12:48:24 +03:00
committed by GitHub
parent 66c8070da8
commit d1ccb22d8a
26 changed files with 2896 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ import React from 'react'
import cn from 'classnames'
import { ChevronDown } from '@/app/components/base/icons/src/vender/line/arrows'
import Popover from '@/app/components/base/popover'
import { languages } from '@/i18n/language'
export type ILanguageSelectProps = {
currentLanguage: string
@@ -20,13 +21,18 @@ const LanguageSelect: FC<ILanguageSelectProps> = ({
trigger='click'
htmlContent={
<div className='w-full py-1'>
<div className='py-2 px-3 mx-1 flex items-center gap-2 hover:bg-gray-100 rounded-lg cursor-pointer text-gray-700 text-sm' onClick={() => onSelect('English')}>English</div>
<div className='py-2 px-3 mx-1 flex items-center gap-2 hover:bg-gray-100 rounded-lg cursor-pointer text-gray-700 text-sm' onClick={() => onSelect('Chinese')}></div>
{languages.filter(language => language.supported).map(({ prompt_name, name }) => (
<div
key={prompt_name}
className='py-2 px-3 mx-1 flex items-center gap-2 hover:bg-gray-100 rounded-lg cursor-pointer text-gray-700 text-sm'
onClick={() => onSelect(prompt_name)}>{prompt_name}
</div>
))}
</div>
}
btnElement={
<div className='inline-flex items-center'>
<span className='pr-[2px] text-xs leading-[18px] font-medium'>{currentLanguage === 'English' ? 'English' : '简体中文'}</span>
<span className='pr-[2px] text-xs leading-[18px] font-medium'>{currentLanguage}</span>
<ChevronDown className='w-3 h-3 opacity-60' />
</div>
}