import React from "react";
import { Button, Spinner } from "reactstrap";

const LoadingButton = ({ handleClickLoadingButton,isLoading = false, ...props }:any) => {
  return (
    <Button onClick={handleClickLoadingButton} type="button" className="btn-primary" disabled={isLoading} {...props}>
      {isLoading ? <Spinner style={{ marginRight: "10px" }} size="sm" /> : null}
      <span >{props.children}</span>
    </Button>
  );
};

export { LoadingButton };

