mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-25 04:53:36 +00:00
Co-authored-by: Fangyin Cheng <staneyffer@gmail.com> Co-authored-by: 谨欣 <echo.cmy@antgroup.com> Co-authored-by: 严志勇 <yanzhiyong@tiansuixiansheng.com> Co-authored-by: yanzhiyong <932374019@qq.com>
47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import { ReadOutlined } from '@ant-design/icons';
|
|
import { Tooltip } from 'antd';
|
|
import { useRouter } from 'next/router';
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
|
|
const Header: React.FC = () => {
|
|
const { t } = useTranslation();
|
|
const router = useRouter();
|
|
|
|
const [showHeader, setShowHeader] = useState(true);
|
|
|
|
useEffect(() => {
|
|
if (
|
|
router.pathname === '/construct/flow/canvas' ||
|
|
router.pathname === '/construct/app/extra' ||
|
|
(router.pathname === '/chat' && router.asPath !== '/chat')
|
|
) {
|
|
setShowHeader(false);
|
|
} else {
|
|
setShowHeader(true);
|
|
}
|
|
}, [router]);
|
|
|
|
if (!showHeader) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<header className='flex items-center justify-end fixed top-0 right-0 h-14 pr-11 bg-transparent'>
|
|
<a href='htt://docs.dbgpt.cn' target='_blank' className='flex items-center h-full mr-4' rel='noreferrer'>
|
|
<Tooltip title={t('docs')}>
|
|
<ReadOutlined />
|
|
</Tooltip>
|
|
</a>
|
|
|
|
<Tooltip>
|
|
<span className='text-sm'>帮助中心</span>
|
|
</Tooltip>
|
|
{/* <UserBar /> */}
|
|
</header>
|
|
);
|
|
};
|
|
|
|
export default Header;
|