import * as React from "react";

export interface IconButtonProps {
  onClick?: () => void;
  /** SVG icon element rendered inside the circular hit area. */
  children: React.ReactNode;
  /** Required - this is an icon-only control with no visible text label. */
  "aria-label": string;
  disabled?: boolean;
  className?: string;
}

export function IconButton({
  onClick,
  children,
  disabled,
  className,
  ...rest
}: IconButtonProps) {
  const classes = ["ads-icon-button"];
  if (className) classes.push(className);
  return (
    <button
      type="button"
      className={classes.join(" ")}
      onClick={onClick}
      disabled={disabled}
      {...rest}
    >
      {children}
    </button>
  );
}
