From f021eb48094b2a5540edced3af6eaa8595381f13 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Mon, 22 Apr 2024 01:03:52 -0400 Subject: [PATCH] Add simple tooltip component --- .../src/app/components/simple-tooltip.tsx | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Frontend/src/app/components/simple-tooltip.tsx diff --git a/Frontend/src/app/components/simple-tooltip.tsx b/Frontend/src/app/components/simple-tooltip.tsx new file mode 100644 index 0000000..5061efb --- /dev/null +++ b/Frontend/src/app/components/simple-tooltip.tsx @@ -0,0 +1,39 @@ +import { ReactElement, ReactNode } from "react"; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui/tooltip"; + +/** + * The props for a simple tooltip. + */ +type SimpleTooltipProps = { + /** + * The content to display in the tooltip. + */ + content: string; + + /** + * The children to render in this tooltip. + */ + children: ReactNode; +}; + +/** + * A simple tooltip, this is wrapping the + * shadcn tooltip to make it easier to use. + * + * @return the tooltip jsx + */ +const SimpleTooltip = ({ + content, + children, +}: SimpleTooltipProps): ReactElement => ( + + {children} + {content} + +); + +export default SimpleTooltip;