import KFIcon from '@/components/KFIcon';
import { ProBreadcrumb } from '@ant-design/pro-components';
import { useModel } from '@umijs/max';
import { Button, Flex } from 'antd';
import React from 'react';
import MessageBroadcast from '../MessageBroadcast';
import Avatar from './AvatarDropdown';
import styles from './index.less';
// import { SelectLang } from '@umijs/max';

export type SiderTheme = 'light' | 'dark';

const GlobalHeaderRight: React.FC = () => {
  const { initialState, setInitialState } = useModel('@@initialState');

  if (!initialState || !initialState.settings) {
    return null;
  }

  const handleMenuCollapse = () => {
    setInitialState((preInitialState) => ({
      ...preInitialState,
      collapsed: !preInitialState?.collapsed,
    }));
  };

  return (
    <div className={styles['right-content']}>
      {/* <span
        className={actionClassName}
        onClick={() => {
          window.open('https://pro.ant.design/docs/getting-started');
        }}
      >
        <QuestionCircleOutlined />
      </span> */}

      <Button
        type="text"
        style={{ marginRight: '4px' }}
        icon={<KFIcon type="icon-collapsed" font={18} style={{ verticalAlign: '-3px' }} />}
        onClick={handleMenuCollapse}
      ></Button>

      <ProBreadcrumb></ProBreadcrumb>

      <Flex
        align="center"
        style={{ marginLeft: 'auto', marginRight: 0, background: '#3a3da5', padding: '0 30px' }}
      >
        <MessageBroadcast />

        <Avatar menu={true} />
      </Flex>

      {/* <SelectLang className={actionClassName} /> */}
    </div>
  );
};
export default GlobalHeaderRight;
