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

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