11import { Link , LinkProps , NavLink , NavLinkProps } from "@remix-run/react" ;
2- import React , { forwardRef , useImperativeHandle , useRef } from "react" ;
2+ import React , { forwardRef , ReactNode , useImperativeHandle , useRef } from "react" ;
33import { ShortcutDefinition , useShortcutKeys } from "~/hooks/useShortcutKeys" ;
44import { cn } from "~/utils/cn" ;
55import { IconNamesOrString , NamedIcon } from "./NamedIcon" ;
@@ -173,10 +173,9 @@ export type ButtonContentPropsType = {
173173 textAlignLeft ?: boolean ;
174174 className ?: string ;
175175 shortcut ?: ShortcutDefinition ;
176- showTooltip ?: boolean ;
177176 variant : keyof typeof variant ;
178177 shortcutPosition ?: "before-trailing-icon" | "after-trailing-icon" ;
179- tooltipDescription ?: string ;
178+ tooltip ?: ReactNode ;
180179 iconSpacing ?: string ;
181180} ;
182181
@@ -191,8 +190,7 @@ export function ButtonContent(props: ButtonContentPropsType) {
191190 fullWidth,
192191 textAlignLeft,
193192 className,
194- showTooltip,
195- tooltipDescription,
193+ tooltip,
196194 iconSpacing,
197195 } = props ;
198196 const variation = allVariants . variant [ props . variant ] ;
@@ -254,7 +252,7 @@ export function ButtonContent(props: ButtonContentPropsType) {
254252 ) ) }
255253
256254 { shortcut &&
257- ! showTooltip &&
255+ ! tooltip &&
258256 props . shortcutPosition === "before-trailing-icon" &&
259257 renderShortcutKey ( ) }
260258
@@ -281,20 +279,20 @@ export function ButtonContent(props: ButtonContentPropsType) {
281279 ) ) }
282280
283281 { shortcut &&
284- ! showTooltip &&
282+ ! tooltip &&
285283 ( ! props . shortcutPosition || props . shortcutPosition === "after-trailing-icon" ) &&
286284 renderShortcutKey ( ) }
287285 </ div >
288286 </ div >
289287 ) ;
290288
291- if ( shortcut && showTooltip ) {
289+ if ( tooltip ) {
292290 return (
293291 < TooltipProvider >
294292 < Tooltip >
295293 < TooltipTrigger asChild > { buttonContent } </ TooltipTrigger >
296294 < TooltipContent className = "text-dimmed flex items-center gap-3 py-1.5 pl-2.5 pr-3 text-xs" >
297- { tooltipDescription } { renderShortcutKey ( ) }
295+ { tooltip } { shortcut && renderShortcutKey ( ) }
298296 </ TooltipContent >
299297 </ Tooltip >
300298 </ TooltipProvider >
0 commit comments