import { type ReactElement, forwardRef, type ComponentPropsWithoutRef } from "react"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; interface IconActionProps extends Omit, "variant" | "size" | "children"> { icon: ReactElement; tooltip?: string; size?: "sm" | "md"; } export const IconAction = forwardRef( function IconAction({ icon, tooltip, size = "md", className, ...props }, ref) { const button = ( ); if (tooltip) { return ( {button} {tooltip} ); } return button; } );