import React from "react";

const Modalbutton = ({
  onRequestClose,
  buttonclassname,
  spanclassname,
  type,
  buttontext,
}: any) => {
  return (
    <>
      {onRequestClose ? (
        <button className={buttonclassname} onClick={() => onRequestClose()}>
          <span className={spanclassname}>{buttontext}</span>
        </button>
      ) : (
        <button
          className={buttonclassname}
          type={type}
          onClick={() => onRequestClose()}
        >
          {buttontext}
        </button>
      )}
    </>
  );
};

export default Modalbutton;
