import React, {ReactNode} from "react"; import {Loader2, LucideIcon} from "lucide-react"; type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'ghost' | 'warning' | 'info' | 'success' | 'dashed'; type ButtonSize = 'sm' | 'md' | 'lg'; interface ButtonProps { variant?: ButtonVariant; size?: ButtonSize; icon?: LucideIcon; isLoading?: boolean; loadingText?: string; disabled?: boolean; children: ReactNode; onClick?: () => void | Promise; type?: 'button' | 'submit'; fullWidth?: boolean; } const variantClasses: Record = { primary: 'bg-primary-dark text-text-primary hover:bg-primary', secondary: 'bg-secondary text-text-primary border border-secondary hover:bg-gray-dark hover:border-gray-dark', danger: 'bg-error text-text-primary hover:bg-error/80', warning: 'bg-warning text-text-primary hover:bg-warning/80', info: 'bg-info text-text-primary hover:bg-info/80', success: 'bg-success text-text-primary hover:bg-success/80', ghost: 'text-muted hover:text-primary hover:bg-primary/10', dashed: 'border-2 border-dashed border-secondary bg-dark-background hover:bg-tertiary text-text-primary', }; const sizeClasses: Record = { sm: 'px-3 py-1.5 text-xs rounded-lg gap-1.5', md: 'px-5 py-2.5 text-sm rounded-xl gap-2', lg: 'px-6 py-3 text-base rounded-xl gap-2', }; export default function Button( { variant = 'primary', size = 'md', icon: Icon, isLoading = false, loadingText, disabled = false, children, onClick, type = 'button', fullWidth = false, }: ButtonProps) { const isDisabled: boolean = disabled || isLoading; return ( ); }