Spaces:
Configuration error
Configuration error
Download frontend/src/components/features/settings/brand-button.tsx from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/components/features/settings/brand-button.tsx
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/components/features/settings/brand-button.tsx
-
curl -L -o brand-button.tsx https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/components/features/settings/brand-button.tsx
1.1 kB
| import { cn } from "#/utils/utils"; | |
| interface BrandButtonProps { | |
| testId?: string; | |
| variant: "primary" | "secondary"; | |
| type: React.ButtonHTMLAttributes<HTMLButtonElement>["type"]; | |
| isDisabled?: boolean; | |
| className?: string; | |
| onClick?: () => void; | |
| startContent?: React.ReactNode; | |
| } | |
| export function BrandButton({ | |
| testId, | |
| children, | |
| variant, | |
| type, | |
| isDisabled, | |
| className, | |
| onClick, | |
| startContent, | |
| }: React.PropsWithChildren<BrandButtonProps>) { | |
| return ( | |
| <button | |
| data-testid={testId} | |
| disabled={isDisabled} | |
| // The type is alreadt passed as a prop to the button component | |
| // eslint-disable-next-line react/button-has-type | |
| type={type} | |
| onClick={onClick} | |
| className={cn( | |
| "w-fit p-2 rounded disabled:opacity-30 disabled:cursor-not-allowed", | |
| variant === "primary" && "bg-primary text-[#0D0F11]", | |
| variant === "secondary" && "border border-primary text-primary", | |
| startContent && "flex items-center justify-center gap-2", | |
| className, | |
| )} | |
| > | |
| {startContent} | |
| {children} | |
| </button> | |
| ); | |
| } | |