import { ButtonHTMLAttributes, forwardRef } from "react";
import { cn } from "../../lib/cn";
import { Loader2 } from "../../lib/icons";
export type ButtonVariant = "default" | "secondary" | "ghost" | "outline" | "destructive" | "link";
export type ButtonSize = "sm" | "md" | "lg" | "icon";
interface ButtonProps extends ButtonHTMLAttributes {
variant?: ButtonVariant;
size?: ButtonSize;
loading?: boolean;
}
const variantClasses: Record = {
default: "bg-primary text-primary-foreground hover:bg-primary/90 active:bg-primary/80",
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 active:bg-secondary/70",
ghost: "hover:bg-accent hover:text-accent-foreground active:bg-accent/80",
outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground active:bg-accent/80",
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 active:bg-destructive/80",
link: "text-primary underline-offset-4 hover:underline active:text-primary/80",
};
const sizeClasses: Record = {
sm: "h-8 px-3 text-xs",
md: "h-10 px-4 text-sm",
lg: "h-12 px-6 text-base",
icon: "h-10 w-10",
};
export const Button = forwardRef(
({ className, variant = "default", size = "md", loading, disabled, children, ...props }, ref) => {
return (
);
}
);
Button.displayName = "Button";