diff --git a/apps/renderer/src/components/ui/button/index.tsx b/apps/renderer/src/components/ui/button/index.tsx index bbdffb50b..1b59b4338 100644 --- a/apps/renderer/src/components/ui/button/index.tsx +++ b/apps/renderer/src/components/ui/button/index.tsx @@ -21,7 +21,7 @@ export interface BaseButtonProps { interface ActionButtonProps { icon?: React.ReactNode | React.FC - tooltip: React.ReactNode + tooltip?: React.ReactNode tooltipSide?: "top" | "bottom" active?: boolean disabled?: boolean @@ -50,47 +50,52 @@ export const ActionButton = React.forwardRef< const buttonRef = React.useRef(null) React.useImperativeHandle(ref, () => buttonRef.current!) + const Trigger = ( + + ) return ( <> {shortcut && buttonRef.current?.click()} />} - - - - - - - {tooltip} - {!!shortcut && ( -
- {shortcut} -
- )} -
-
-
+ {tooltip ? ( + + {Trigger} + + + {tooltip} + {!!shortcut && ( +
+ {shortcut} +
+ )} +
+
+
+ ) : ( + Trigger + )} ) }, diff --git a/apps/renderer/src/components/user-button.tsx b/apps/renderer/src/components/user-button.tsx index 36642d2cd..9c361f721 100644 --- a/apps/renderer/src/components/user-button.tsx +++ b/apps/renderer/src/components/user-button.tsx @@ -75,7 +75,7 @@ export const ProfileButton: FC = memo((props) => { return ( - +