Download frontend/src/components/landing/Button.jsx from tamgaa/app: direct link, hf CLI and curl.
- Browser
- Download file 764 Bytes
-
https://huggingface.co/spaces/tamgaa/app/resolve/main/frontend/src/components/landing/Button.jsx
- Command line
-
hf download hf://spaces/tamgaa/app/frontend/src/components/landing/Button.jsx
-
curl -L -o Button.jsx https://huggingface.co/spaces/tamgaa/app/resolve/main/frontend/src/components/landing/Button.jsx
764 Bytes
| // Studio landing shared button (SHARED CONTRACT). | |
| // Renders an <a> when `href` is provided, otherwise a <button>. | |
| // Variants: "primary" | "secondary" | "tertiary" -> .st-btn--{variant} (see base.css). | |
| export default function Button({ | |
| variant = "primary", | |
| children, | |
| onClick, | |
| href, | |
| ariaLabel, | |
| ...rest | |
| }) { | |
| const className = `st-btn st-btn--${variant}`; | |
| if (href) { | |
| return ( | |
| <a | |
| className={className} | |
| href={href} | |
| onClick={onClick} | |
| aria-label={ariaLabel} | |
| {...rest} | |
| > | |
| {children} | |
| </a> | |
| ); | |
| } | |
| return ( | |
| <button | |
| type="button" | |
| className={className} | |
| onClick={onClick} | |
| aria-label={ariaLabel} | |
| {...rest} | |
| > | |
| {children} | |
| </button> | |
| ); | |
| } | |