generated from layer5io/layer5-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
- Loading branch information
1 parent
7f7b991
commit 20f508a
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { TooltipIcon } from './tooltipicon'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { IconButton, IconButtonProps, Tooltip as MuiTooltip } from '@mui/material'; | ||
import React, { ReactNode } from 'react'; | ||
|
||
interface TooltipIconProps { | ||
icon: ReactNode; | ||
tooltipTitle: string; | ||
iconButtonProps?: IconButtonProps; | ||
} | ||
|
||
export const TooltipIcon: React.FC<TooltipIconProps> = ({ | ||
icon, | ||
tooltipTitle, | ||
iconButtonProps = {} | ||
}: TooltipIconProps) => { | ||
return ( | ||
<MuiTooltip title={tooltipTitle} arrow> | ||
<IconButton {...iconButtonProps}>{icon}</IconButton> | ||
</MuiTooltip> | ||
); | ||
}; |