import React from "react"; import {LucideIcon} from "lucide-react"; type IconButtonVariant = 'primary' | 'danger' | 'ghost' | 'muted' | 'light'; type IconButtonSize = 'sm' | 'md' | 'lg'; type IconButtonShape = 'circle' | 'square'; interface IconButtonProps { icon: LucideIcon; variant?: IconButtonVariant; size?: IconButtonSize; shape?: IconButtonShape; onClick?: () => void | Promise; disabled?: boolean; selected?: boolean; tooltip?: string; } const variantClasses: Record = { primary: 'text-muted hover:text-primary hover:bg-primary/10', danger: 'text-muted hover:text-error hover:bg-error/10', ghost: 'text-text-secondary hover:text-text-primary hover:bg-secondary', muted: 'bg-secondary hover:bg-gray-dark text-text-secondary hover:text-text-primary', light: 'text-text-primary/80 hover:text-text-primary hover:bg-text-primary/10', }; const sizeClasses: Record = { sm: {button: 'p-1.5', icon: 'w-4 h-4'}, md: {button: 'p-2', icon: 'w-5 h-5'}, lg: {button: 'p-2', icon: 'w-6 h-6'}, }; const shapeClasses: Record = { circle: 'rounded-full', square: 'rounded-lg', }; export default function IconButton( { icon: Icon, variant = 'ghost', size = 'md', shape = 'square', onClick, disabled = false, selected = false, tooltip, }: IconButtonProps) { const sizeConfig = sizeClasses[size]; const selectedClass: string = selected ? 'bg-secondary text-primary' : ''; return ( ); }