File tree Expand file tree Collapse file tree
apps/webapp/app/components/primitives Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -341,7 +341,7 @@ export const Button = forwardRef<HTMLButtonElement, ButtonPropsType>(
341341 disabled : isDisabled || ! props . shortcut ,
342342 } ) ;
343343
344- return (
344+ const buttonElement = (
345345 < button
346346 className = { cn ( "group/button outline-none focus-custom" , props . fullWidth ? "w-full" : "" ) }
347347 type = { type }
@@ -353,9 +353,30 @@ export const Button = forwardRef<HTMLButtonElement, ButtonPropsType>(
353353 form = { props . form }
354354 autoFocus = { autoFocus }
355355 >
356- < ButtonContent { ...props } />
356+ < ButtonContent { ...props } tooltip = { undefined } />
357357 </ button >
358358 ) ;
359+
360+ if ( props . tooltip ) {
361+ return (
362+ < TooltipProvider >
363+ < Tooltip >
364+ < TooltipTrigger asChild >
365+ < span className = { isDisabled ? "cursor-default" : undefined } >
366+ { buttonElement }
367+ </ span >
368+ </ TooltipTrigger >
369+ < TooltipContent className = "flex items-center gap-3 py-1.5 pl-2.5 pr-3 text-xs text-text-bright" >
370+ { props . tooltip } { props . shortcut && ! props . hideShortcutKey && (
371+ < ShortcutKey shortcut = { props . shortcut } variant = "medium" className = "ml-1" />
372+ ) }
373+ </ TooltipContent >
374+ </ Tooltip >
375+ </ TooltipProvider >
376+ ) ;
377+ }
378+
379+ return buttonElement ;
359380 }
360381) ;
361382
You can’t perform that action at this time.
0 commit comments