import React, { useEffect, useState } from "react";
import styles from "./index.module.scss";
import { useLocation } from "react-router-dom";
import { urlParameter } from "@/utils/history";
import Tab5Info from "../A2Main/Tab5Info";
function A4Know() {
  const [id, setId] = useState("");

  // 获取地址栏参数
  const location = useLocation();
  useEffect(() => {
    const obj = urlParameter(location.search);
    if (obj.id) setId(obj.id);
    else alert("参数错误!");
  }, [location.search]);
  return (
    <div className={styles.A4Know}>
      {id ? <Tab5Info sId={id} closeFu={() => {}} isOpen={true} /> : null}
    </div>
  );
}

const MemoA4Know = React.memo(A4Know);

export default MemoA4Know;
