Skip to content

Commit

Permalink
feat(component): tooltip icon
Browse files Browse the repository at this point in the history
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
  • Loading branch information
sudhanshutech committed Nov 28, 2023
1 parent 7f7b991 commit 20f508a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/components/src/base/TooltipIcon/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { TooltipIcon } from './tooltipicon';
20 changes: 20 additions & 0 deletions packages/components/src/base/TooltipIcon/tooltipicon.tsx
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>
);
};

0 comments on commit 20f508a

Please sign in to comment.