Spaces:
Configuration error
Configuration error
Download frontend/src/components/shared/buttons/icon-button.tsx from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 612 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/components/shared/buttons/icon-button.tsx
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/src/components/shared/buttons/icon-button.tsx
-
curl -L -o icon-button.tsx https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/src/components/shared/buttons/icon-button.tsx
612 Bytes
| import { Button } from "@heroui/react"; | |
| import React, { ReactElement } from "react"; | |
| export interface IconButtonProps { | |
| icon: ReactElement; | |
| onClick: () => void; | |
| ariaLabel: string; | |
| testId?: string; | |
| } | |
| export function IconButton({ | |
| icon, | |
| onClick, | |
| ariaLabel, | |
| testId = "", | |
| }: IconButtonProps): React.ReactElement { | |
| return ( | |
| <Button | |
| type="button" | |
| variant="flat" | |
| onPress={onClick} | |
| className="cursor-pointer text-[12px] bg-transparent aspect-square px-0 min-w-[20px] h-[20px]" | |
| aria-label={ariaLabel} | |
| data-testid={testId} | |
| > | |
| {icon} | |
| </Button> | |
| ); | |
| } | |