import styles from "./index.module.scss";
import { Spin } from "antd";
import React from "react";
import classNames from "classnames";
import { useSelector } from "react-redux";
import { RootState } from "@/store";

function AsyncSpinLoding() {
  // 从仓库中获取查看图片的信息
  const asyncLoding = useSelector(
    (state: RootState) => state.loginStore.asyncLoding
  );

  return (
    <div
      id="AsyncSpinLoding"
      className={classNames(
        styles.AsyncSpinLoding,
        asyncLoding ? styles.AsyncSpinLodingShow : ""
      )}
    >
      <Spin size="large" />
    </div>
  );
}

const MemoAsyncSpinLoding = React.memo(AsyncSpinLoding);

export default MemoAsyncSpinLoding;
