File size: 1,594 Bytes
88e5a61 cfbf213 88e5a61 503735c 88e5a61 503735c 88e5a61 503735c 7c4aa10 503735c 88e5a61 503735c 88e5a61 cfbf213 88e5a61 cfbf213 503735c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
import { ReactComponent as TranslationIcon } from '@/assets/svg/translation.svg';
import { useTranslate } from '@/hooks/commonHooks';
import { GithubOutlined } from '@ant-design/icons';
import { Dropdown, MenuProps, Space } from 'antd';
import React from 'react';
import User from '../user';
import { useChangeLanguage } from '@/hooks/logicHooks';
import styled from './index.less';
const Circle = ({ children, ...restProps }: React.PropsWithChildren) => {
return (
<div {...restProps} className={styled.circle}>
{children}
</div>
);
};
const handleGithubCLick = () => {
window.open('https://github.com/infiniflow/ragflow', 'target');
};
const RightToolBar = () => {
const { t } = useTranslate('common');
const changeLanguage = useChangeLanguage();
const handleItemClick: MenuProps['onClick'] = ({ key }) => {
changeLanguage(key);
};
const items: MenuProps['items'] = [
{
key: 'English',
label: <span>{t('english')}</span>,
},
{ type: 'divider' },
{
key: 'Chinese',
label: <span>{t('chinese')}</span>,
},
];
return (
<div className={styled.toolbarWrapper}>
<Space wrap size={16}>
<Circle>
<GithubOutlined onClick={handleGithubCLick} />
</Circle>
<Dropdown menu={{ items, onClick: handleItemClick }} placement="bottom">
<Circle>
<TranslationIcon />
</Circle>
</Dropdown>
{/* <Circle>
<MonIcon />
</Circle> */}
<User></User>
</Space>
</div>
);
};
export default RightToolBar;
|