import React from "react";
import { SmallSpinner } from "../Sppiner";

function LoadingIcon(props: any) {
  const { children, inProgress, className } = props;
  const p = {
    color: props?.color ? props.color : null,
  };
  return (
    <>
      {inProgress ? (
        <>
          <div className={className}>
            <SmallSpinner {...p} />
          </div>
        </>
      ) : (
        <>{children}</>
      )}
    </>
  );
}

export default LoadingIcon;
