MCPcopy
hub / github.com/adrianhajdin/brainwave / Button

Function Button

src/components/Button.jsx:3–24  ·  view source on GitHub ↗
({ className, href, onClick, children, px, white })

Source from the content-addressed store, hash-verified

1import ButtonSvg from "../assets/svg/ButtonSvg";
2
3const Button = ({ className, href, onClick, children, px, white }) => {
4 const classes = `button relative inline-flex items-center justify-center h-11 transition-colors hover:text-color-1 ${
5 px || "px-7"
6 } ${white ? "text-n-8" : "text-n-1"} ${className || ""}`;
7 const spanClasses = "relative z-10";
8
9 const renderButton = () => (
10 <button className={classes} onClick={onClick}>
11 <span className={spanClasses}>{children}</span>
12 {ButtonSvg(white)}
13 </button>
14 );
15
16 const renderLink = () => (
17 <a href={href} className={classes}>
18 <span className={spanClasses}>{children}</span>
19 {ButtonSvg(white)}
20 </a>
21 );
22
23 return href ? renderLink() : renderButton();
24};
25
26export default Button;

Callers

nothing calls this directly

Calls 2

renderLinkFunction · 0.85
renderButtonFunction · 0.85

Tested by

no test coverage detected