import * as React from 'react';
import classNames from 'classnames';
import { FormattedMessage } from 'react-intl';
import { Link } from 'bisheng/router';
import type { MenuProps } from 'antd';
import { MenuOutlined } from '@ant-design/icons';
import { Menu } from 'antd';
import { getEcosystemGroup } from './More';
import * as utils from '../../utils';
import type { SharedProps } from './interface';
import './Navigation.less';
export interface NavigationProps extends SharedProps {
isMobile: boolean;
pathname: string;
responsive: null | 'narrow' | 'crowded';
location: { pathname: string; query: any };
directionText: string;
showTechUIButton: boolean;
onLangChange: () => void;
onDirectionChange: () => void;
}
export default ({
isZhCN,
isMobile,
pathname,
responsive,
location,
directionText,
showTechUIButton,
onLangChange,
onDirectionChange,
}: NavigationProps) => {
const menuMode = isMobile ? 'inline' : 'horizontal';
const module = pathname.split('/').slice(0, -1).join('/');
let activeMenuItem = module || 'home';
if (location.pathname === 'changelog' || location.pathname === 'changelog-cn') {
activeMenuItem = 'docs/react';
} else if (location.pathname === 'docs/resources' || location.pathname === 'docs/resources-cn') {
activeMenuItem = 'docs/resources';
}
let additional: MenuProps['items'];
const additionalItems: MenuProps['items'] = [
{
label: (
Github
),
key: 'github',
},
{
label: