Skip to content

Commit

Permalink
Update Tooltip.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ArhanAnsari authored Oct 9, 2024
1 parent 68b602b commit 75bc6d0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
import React from "react";
import { Tooltip as ReactTooltip } from "react-tooltip";

const Tooltip: React.FC<{ id: string; text: string; children: React.ReactNode }> = ({ id, text, children }) => (
interface TooltipProps {
id: string;
text: string;
children: React.ReactNode;
}

const Tooltip: React.FC<TooltipProps> = ({ id, text, children }) => (
<>
<span className="relative cursor-pointer underline" data-tooltip-id={id} data-tooltip-content={text}>
<span className="relative cursor-pointer underline" data-tooltip-id={id} data-tooltip-content={text} aria-label={text}>
{children}
</span>
<ReactTooltip id={id} />
Expand Down

0 comments on commit 75bc6d0

Please sign in to comment.