add a tooltip wrapper
All checks were successful
Deploy SSR / deploy (push) Successful in 1m12s

This commit is contained in:
Lee
2024-09-12 17:52:01 +01:00
parent b3c37afa0e
commit 8da9ec73d1
3 changed files with 45 additions and 32 deletions

View File

@ -0,0 +1,22 @@
import { Tooltip as ShadCnTooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip";
type Props = {
/**
* What will trigger the tooltip
*/
children: React.ReactNode;
/**
* What will be displayed in the tooltip
*/
display: React.ReactNode;
};
export default function Tooltip({ children, display }: Props) {
return (
<ShadCnTooltip>
<TooltipTrigger asChild>{children}</TooltipTrigger>
<TooltipContent>{display}</TooltipContent>
</ShadCnTooltip>
);
}