Spaces:
Running on Zero
Running on Zero
deveshc23
feat: Add Free Gradio Space support, Git LFS tracking for data artifacts, and Quant Allocator
3e33e2e Download frontend/src/components/common/Button.tsx from deveshc23/drift-quant: direct link, hf CLI and curl.
- Browser
- Download file 790 Bytes
-
https://huggingface.co/spaces/deveshc23/drift-quant/resolve/main/frontend/src/components/common/Button.tsx
- Command line
-
hf download hf://spaces/deveshc23/drift-quant/frontend/src/components/common/Button.tsx
-
curl -L -o Button.tsx https://huggingface.co/spaces/deveshc23/drift-quant/resolve/main/frontend/src/components/common/Button.tsx
790 Bytes
| import type { ButtonHTMLAttributes, ReactNode } from "react"; | |
| interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { | |
| variant?: "primary" | "secondary" | "ghost" | "danger" | "outline"; | |
| size?: "xs" | "sm" | "md" | "lg"; | |
| icon?: ReactNode; | |
| children: ReactNode; | |
| loading?: boolean; | |
| } | |
| export function Button({ | |
| variant = "secondary", | |
| size = "sm", | |
| icon, | |
| children, | |
| loading = false, | |
| className = "", | |
| disabled, | |
| ...props | |
| }: ButtonProps) { | |
| return ( | |
| <button | |
| className={`btn btn-${variant} btn-${size} ${className}`} | |
| disabled={disabled || loading} | |
| {...props} | |
| > | |
| {loading ? ( | |
| <span className="spinner" /> | |
| ) : ( | |
| icon && <span className="btn-icon">{icon}</span> | |
| )} | |
| {children} | |
| </button> | |
| ); | |
| } | |