MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / Tip

Function Tip

apps/baseai.dev/src/components/ui/tip.tsx:13–61  ·  view source on GitHub ↗
({
	icon,
	asChild,
	content,
	children,
	className,
	show = true
}: {
	icon?: boolean;
	asChild?: boolean;
	className?: string;
	content: React.ReactNode | string;
	children: React.ReactNode;
	show?: boolean;
})

Source from the content-addressed store, hash-verified

11import React from 'react';
12
13export default function Tip({
14 icon,
15 asChild,
16 content,
17 children,
18 className,
19 show = true
20}: {
21 icon?: boolean;
22 asChild?: boolean;
23 className?: string;
24 content: React.ReactNode | string;
25 children: React.ReactNode;
26 show?: boolean;
27}) {
28 if (!show) return <>{children}</>;
29 return (
30 <TooltipProvider delayDuration={50}>
31 <Tooltip>
32 <TooltipTrigger
33 className={cn(
34 icon && `flex shrink-0 gap-1 items-center`,
35 className
36 )}
37 asChild={asChild}
38 >
39 {asChild ? (
40 <span className="cursor-pointer">
41 {icon && (
42 <InformationCircleIcon className="size-5 self-center" />
43 )}
44 {children}
45 </span>
46 ) : (
47 <>
48 {icon && (
49 <InformationCircleIcon className="size-5 self-center" />
50 )}
51 {children}
52 </>
53 )}
54 </TooltipTrigger>
55 <TooltipContent className="max-w-sm whitespace-pre-wrap">
56 {content}
57 </TooltipContent>
58 </Tooltip>
59 </TooltipProvider>
60 );
61}
62
63export function TipCode({ children }: { children: React.ReactNode }) {
64 return (

Callers

nothing calls this directly

Calls 1

cnFunction · 0.50

Tested by

no test coverage detected