aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/ui/info-tooltip.tsx
blob: eeace885b6ff634491216969a08edd1c70d8a7fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import {
  Tooltip,
  TooltipContent,
  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 (
    <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>
  );
}