-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui(web): Add a tooltip explaining what archived means
- Loading branch information
1 parent
bc6ee2e
commit 4cf9908
Showing
4 changed files
with
60 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> | ||
); | ||
} |