"use client" import type React from "react" import { forwardRef } from "react" import { Tooltip, TooltipContent, TooltipTrigger, } from "@/components/ui/tooltip" import { cn } from "@/lib/utils" interface IconButtonProps extends React.ComponentProps<"button"> { label: string /** Shown next to the label in the tooltip, e.g. "⌘B" */ shortcut?: string tooltipSide?: "top" | "bottom" | "left" | "right" } /** Square icon button with a tooltip; the tooltip text is also its label */ export const IconButton = forwardRef( function IconButton( { label, shortcut, tooltipSide = "bottom", className, children, ...props }, ref, ) { return ( {label} {shortcut && ( {shortcut} )} ) }, )