import type React from 'react'; import { X, Plus } from 'lucide-react'; import { motion } from 'framer-motion'; import type { ButtonHTMLAttributes } from 'react'; import type { LucideIcon } from 'lucide-react'; import { cn } from '~/utils'; interface BadgeProps extends Omit< ButtonHTMLAttributes, 'onAnimationStart' | 'onDragStart' | 'onDragEnd' | 'onDrag' > { icon?: LucideIcon; label: string; id?: string; isActive?: boolean; isEditing?: boolean; isDragging?: boolean; isAvailable: boolean; isInChat?: boolean; onBadgeAction?: () => void; onToggle?: () => void; } export default function Badge({ icon: Icon, label, id, isActive = false, isEditing = false, isDragging = false, isAvailable = true, isInChat = false, onBadgeAction, onToggle, className, ...props }: BadgeProps) { const isMoveable = isEditing && isAvailable; const isDisabled = id === '1' && isInChat; const handleClick: React.MouseEventHandler = (e) => { if (isDisabled) { e.preventDefault(); e.stopPropagation(); return; } if (!isEditing && onToggle) { e.preventDefault(); e.stopPropagation(); onToggle(); } }; const getWhileTapScale = () => { if (isDragging) { return 1.1; } if (isDisabled) { return 1; } return 0.97; }; return ( )} > {Icon && ( ); }