({ className, href, onClick, children, px, white })
| 1 | import ButtonSvg from "../assets/svg/ButtonSvg"; |
| 2 | |
| 3 | const 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 | |
| 26 | export default Button; |
nothing calls this directly
no test coverage detected