This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
scoresaber-reloadedv3/projects/website/src/components/tooltip.tsx
Liam ae2f30a97a
All checks were successful
Deploy Website / deploy (push) Successful in 5m5s
add hover to all country flags
2024-10-13 00:41:39 +01:00

33 lines
730 B
TypeScript

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;
/**
* Display the trigger as a child element.
*/
asChild?: boolean;
/**
* Where the tooltip will be displayed
*/
side?: "top" | "bottom" | "left" | "right";
};
export default function Tooltip({ children, display, asChild = true, side = "top" }: Props) {
return (
<ShadCnTooltip>
<TooltipTrigger asChild={asChild}>{children}</TooltipTrigger>
<TooltipContent side={side}>{display}</TooltipContent>
</ShadCnTooltip>
);
}