import type { ButtonHTMLAttributes, ReactNode } from "react";

export type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";

type Props = ButtonHTMLAttributes<HTMLButtonElement> & {
  variant?: ButtonVariant;
  children: ReactNode;
};

export function Button({ variant = "primary", className = "", children, type = "button", ...rest }: Props) {
  return (
    <button type={type} className={`hb-btn hb-btn--${variant} ${className}`.trim()} {...rest}>
      {children}
    </button>
  );
}
