Jon/debugger layout (#3340)
This commit is contained in:
31
skyvern-frontend/src/components/Tip.tsx
Normal file
31
skyvern-frontend/src/components/Tip.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
|
||||
function Tip({
|
||||
asChild = true,
|
||||
children,
|
||||
content,
|
||||
}: {
|
||||
asChild?: boolean;
|
||||
children: React.ReactNode;
|
||||
content: string | null;
|
||||
}) {
|
||||
if (content === null) {
|
||||
return children;
|
||||
}
|
||||
|
||||
return (
|
||||
<TooltipProvider>
|
||||
<Tooltip delayDuration={300}>
|
||||
<TooltipTrigger asChild={asChild}>{children}</TooltipTrigger>
|
||||
<TooltipContent className="max-w-[250px]">{content}</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export { Tip };
|
||||
Reference in New Issue
Block a user