Spaces:
Paused
Paused
Download frontend/packages/shared/src/components/Button.tsx from 3SCError404/nexus: direct link, hf CLI and curl.
- Browser
- Download file 678 Bytes
-
https://huggingface.co/spaces/3SCError404/nexus/resolve/main/frontend/packages/shared/src/components/Button.tsx
- Command line
-
hf download hf://spaces/3SCError404/nexus/frontend/packages/shared/src/components/Button.tsx
-
curl -L -o Button.tsx https://huggingface.co/spaces/3SCError404/nexus/resolve/main/frontend/packages/shared/src/components/Button.tsx
678 Bytes
| import React from 'react'; | |
| import styles from './Button.module.css'; | |
| interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { | |
| variant?: 'primary' | 'secondary' | 'outline' | 'ghost'; | |
| size?: 'sm' | 'md' | 'lg'; | |
| loading?: boolean; | |
| } | |
| export const Button: React.FC<ButtonProps> = ({ | |
| children, | |
| variant = 'primary', | |
| size = 'md', | |
| loading, | |
| className, | |
| disabled, | |
| ...props | |
| }) => { | |
| return ( | |
| <button | |
| className={`${styles.button} ${styles[variant]} ${styles[size]} ${className || ''}`} | |
| disabled={disabled || loading} | |
| {...props} | |
| > | |
| {loading ? <span className={styles.loader}></span> : children} | |
| </button> | |
| ); | |
| }; | |