import React from "react";
import { Spin } from "antd";
import "./loading-spinner.styles.scss";

export default function LoadingSpinnerAtom({
  loading = true,
  message,
  ...props
}) {
  return (
    <div className="loading-spinner">
      <Spin
        spinning={loading}
        size="large"
        style={{
          position: "relative",
          alignContent: "center",
        }}
        tip={message ? message : null}
      >
        {props.children}
      </Spin>
    </div>
  );
}
