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

Function Button

apps/baseai.dev/src/components/Button.tsx:37–82  ·  view source on GitHub ↗
({
	variant = 'primary',
	className,
	children,
	arrow,
	...props
}: ButtonProps)

Source from the content-addressed store, hash-verified

35);
36
37export function Button({
38 variant = 'primary',
39 className,
40 children,
41 arrow,
42 ...props
43}: ButtonProps) {
44 className = clsx(
45 'inline-flex gap-0.5 justify-center overflow-hidden text-base font-medium transition',
46 variantStyles[variant],
47 className
48 );
49
50 let arrowIcon = (
51 <ArrowIcon
52 className={clsx(
53 'mt-0.5 h-5 w-5',
54 variant === 'text' && 'relative top-px',
55 arrow === 'left' && '-ml-1 rotate-180',
56 arrow === 'right' && '-mr-1'
57 )}
58 />
59 );
60
61 let inner = (
62 <>
63 {arrow === 'left' && arrowIcon}
64 {children}
65 {arrow === 'right' && arrowIcon}
66 </>
67 );
68
69 if (typeof props.href === 'undefined') {
70 return (
71 <button className={className} {...props}>
72 {inner}
73 </button>
74 );
75 }
76
77 return (
78 <Link className={className} {...props}>
79 {inner}
80 </Link>
81 );
82}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected