import { QuestionCircleOutlined } from '@ant-design/icons' ; import { Tooltip } from 'antd' ; import React from 'react' ; import { connect } from 'dva' ; import type { ConnectProps , ConnectState } from '@/models/connect' ; import Avatar from './AvatarDropdown' ; import HeaderSearch from '../HeaderSearch' ; import SelectLang from '../SelectLang' ; import styles from './index.less' ; export type SiderTheme = 'light' | 'dark' ; export type GlobalHeaderRightProps = { theme ? : SiderTheme ; layout : 'sidemenu' | 'topmenu' ; } & ConnectProps ; const GlobalHeaderRight = ( props ) => { const { theme , layout } = props ; let className = styles . right ; if ( theme === 'dark' && layout === 'topmenu' ) { className = `${ styles . right }  ${ styles . dark }` ; } return ( < div className = { className } > < HeaderSearch className = { `${ styles . action } ${ styles . search }` } placeholder = "站内搜索" defaultValue = "umi ui" options = { [ { label : < a href = "https://umijs.org/zh/guide/umi-ui.html" > umi ui < / a > , value : 'umi ui' } , { label : < a href = "next.ant.design" > Ant Design < / a > , value : 'Ant Design' , } , { label : < a href = "https://protable.ant.design/" > Pro Table < /a>, value : 'Pro Table' , } , { label : < a href = "https://prolayout.ant.design/" > Pro Layout < /a>, value : 'Pro Layout' , } , ] } /> < Tooltip title = "使用文档" > < a target = "_blank" href = "https://pro.ant.design/docs/getting-started" rel = "noopener noreferrer" className = { styles . action } > < QuestionCircleOutlined /> < /a> < /Tooltip> < Avatar / > < SelectLang className = { styles . action } /> < /div>); } ; export default connect ( ( { settings } ) => ( { theme : settings . navTheme , layout : settings . layout , } ) ) ( GlobalHeaderRight ) ;