deveshc23
feat: Add Free Gradio Space support, Git LFS tracking for data artifacts, and Quant Allocator
3e33e2e
Raw History Blame Contribute Delete
790 Bytes
import type { ButtonHTMLAttributes, ReactNode } from "react";
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: "primary" | "secondary" | "ghost" | "danger" | "outline";
size?: "xs" | "sm" | "md" | "lg";
icon?: ReactNode;
children: ReactNode;
loading?: boolean;
}
export function Button({
variant = "secondary",
size = "sm",
icon,
children,
loading = false,
className = "",
disabled,
...props
}: ButtonProps) {
return (
<button
className={`btn btn-${variant} btn-${size} ${className}`}
disabled={disabled || loading}
{...props}
>
{loading ? (
<span className="spinner" />
) : (
icon && <span className="btn-icon">{icon}</span>
)}
{children}
</button>
);
}