import React, { useEffect, useState } from 'react';
import { Modal, Card, Empty } from 'antd';
import { useHistory } from 'react-router-dom';
import classnames from 'classnames';
import styles from './index.less';
import weixiu from '@/assets/images/logo/weixiu.svg';
import jumpImg from '@/assets/images/logo/jumpImg.png';
const JumpContainer = props => {
  const [url, setUrl] = useState('');
  const jumpTo = useHistory();
  useEffect(() => {
    const jumpUrl = window.location.origin;
    const address = `${jumpUrl}/cityoms3/4.0.html`;
    setUrl(address);
    // openInNewTab(address);
  }, []);

  const openInNewTab = address => {
    jumpTo.goBack();
    window.open(address, '_blank');
    console.table(jumpTo);
  };
  return (
    <>
      <div className={classnames(`${styles.box}`)}>
        <img
          src={jumpImg}
          alt=""
          className={classnames({
            [styles.imgs]: true,
          })}
        />
        <p className={styles.desc}>
          业务平台建设中，点击链接跳转
          {url && (
            <a
              target="_blank"
              href={url}
              rel="noopener noreferer"
              className={classnames({
                [styles.link]: true,
              })}
            >
              运维平台4.0
            </a>
          )}
        </p>
      </div>
    </>
  );
};

export default JumpContainer;
