import {FC, ReactNode} from "react";

interface ButtonProps {
  children: ReactNode | null;
  onClick?: () => void;
  className: string | "";
  disabled?: boolean;
  type?: "submit"|"button";
}

const Button: FC<ButtonProps> = ({children, onClick, className, disabled, type}) => {
 return <>
   <button className={"bg-blue-500 text-white p-2 rounded block disabled:bg-gray-300 disabled:cursor-not-allowed " + className}
           onClick={onClick}
           type={ type ? type : 'button'}
           disabled={disabled}>
     { children }
   </button>
 </>
}

export default Button;