import React from "react";
import "./Button.css";

const Button = ({
  variant = "primary",
  type = "button",
  onClick,
  disabled = false,
  children,
  className = "",
  icon,
  ...props
}) => {
  const buttonClasses = `btn btn-${variant} ${className}`.trim();

  return (
    <button
      type={type}
      className={buttonClasses}
      onClick={onClick}
      disabled={disabled}
      {...props}
    >
      {icon && <span className="btn-icon">{icon}</span>}
      {children && <span className="btn-text">{children}</span>}
    </button>
  );
};

export default Button;

