diff options
| author | MohamedBassem <me@mbassem.com> | 2024-04-06 01:35:37 +0100 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-04-06 01:35:37 +0100 |
| commit | 4cf990816817c009a512356373fdb1c4baa5e63b (patch) | |
| tree | 87109f8b1ad0d2a02b0936745472dc4347167f18 /apps/web/components/ui | |
| parent | bc6ee2edc9f16791b2bb64049c2c34ed83796d29 (diff) | |
| download | karakeep-4cf990816817c009a512356373fdb1c4baa5e63b.tar.zst | |
ui(web): Add a tooltip explaining what archived means
Diffstat (limited to 'apps/web/components/ui')
| -rw-r--r-- | apps/web/components/ui/info-tooltip.tsx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/apps/web/components/ui/info-tooltip.tsx b/apps/web/components/ui/info-tooltip.tsx new file mode 100644 index 00000000..abaf8197 --- /dev/null +++ b/apps/web/components/ui/info-tooltip.tsx @@ -0,0 +1,38 @@ +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import { cn } from "@/lib/utils"; +import { HelpCircle, Info } from "lucide-react"; + +export default function InfoTooltip({ + className, + children, + size, + variant = "tip", +}: { + className?: string; + size?: number; + children?: React.ReactNode; + variant?: "tip" | "explain"; +}) { + return ( + <TooltipProvider delayDuration={0}> + <Tooltip> + <TooltipTrigger asChild> + {variant === "tip" ? ( + <Info className={cn("cursor-pointer", className)} size={size} /> + ) : ( + <HelpCircle + className={cn("cursor-pointer", className)} + size={size} + /> + )} + </TooltipTrigger> + <TooltipContent>{children}</TooltipContent> + </Tooltip> + </TooltipProvider> + ); +} |
