Skip to content

Commit

Permalink
feat: Add TooltipWrapper component for enhanced UI tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
Manancode committed Oct 16, 2024
1 parent d7548c9 commit 560e07c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions library/src/components/ToolTipWrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React, { ReactNode } from "react";

interface TooltipWrapperProps {
children: ReactNode;
description?: string;
className?: string;
}

export const TooltipWrapper: React.FC<TooltipWrapperProps> = ({
children,
description,
className,
}) => {
if (!description) {
return <>{children}</>;
}

return (
<span title={description} className={className}>
{children}
</span>
);
};

0 comments on commit 560e07c

Please sign in to comment.