import { ButtonProps } from '../lib/interfaces';

export default function Button({
    children,
    onClick,
    bgColor = "bg-[#521392]",
    textColor = "text-white",
    hover = "hover:bg-[#9E5AE3]",
    paddingVertical = "py-4",
    paddingHorizontal = "px-5",
    width = "100%",
    border = "border-none",
    borderColor = "",
    type,
    disabled = false,
    marginBottom = "",
    className = "",
}: ButtonProps) {
    return (
        <button
            onClick={onClick}
            type={type}
            className={
                `${bgColor} 
                 ${textColor} 
                 ${hover} 
                 ${paddingVertical} 
                 ${paddingHorizontal} 
                 ${width}
                ${marginBottom} 
                ${border} 
                 font-bold 
                 rounded-xl
                 cursor-pointer
                 ${className}`
            }
            disabled={disabled}
            style={{ backgroundColor: bgColor, width: width, borderColor: borderColor, borderWidth: border ? '1px' : '0' }}
        >
            {children}
        </button>
    );
}
