import type { ButtonHTMLAttributes, ReactNode } from "react";
type ButtonVariant = "primary" | "secondary" | "ghost" | "outline";
type ButtonSize = "sm" | "md" | "lg";
export interface ButtonProps extends ButtonHTMLAttributes {
variant?: ButtonVariant;
size?: ButtonSize;
children: ReactNode;
loading?: boolean;
loadingText?: string;
}
const variantClasses: Record = {
primary: "bg-primary text-white hover:opacity-90 shadow-sm",
secondary: "bg-secondary text-white hover:opacity-90",
ghost: "bg-transparent text-secondary hover:bg-[var(--color-secondary-muted)]",
outline:
"border border-gray-200 bg-white text-secondary hover:border-primary hover:text-primary",
};
const sizeClasses: Record = {
sm: "px-3 py-1.5 text-sm",
md: "px-5 py-2.5 text-sm",
lg: "px-6 py-3 text-base",
};
export function Button({
variant = "primary",
size = "md",
className = "",
children,
loading = false,
loadingText,
disabled,
...props
}: ButtonProps) {
return (
);
}