Download apps/readest-app/src/components/Button.tsx from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 771 Bytes
-
https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/components/Button.tsx
- Command line
-
hf download hf://datasets/echodict/readest/apps/readest-app/src/components/Button.tsx
-
curl -L -o Button.tsx https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/components/Button.tsx
771 Bytes
| import clsx from 'clsx'; | |
| import React from 'react'; | |
| import { useEnv } from '@/context/EnvContext'; | |
| interface ButtonProps { | |
| icon: React.ReactNode; | |
| onClick: () => void; | |
| disabled?: boolean; | |
| label?: string; | |
| className?: string; | |
| } | |
| const Button: React.FC<ButtonProps> = ({ icon, onClick, disabled = false, label, className }) => { | |
| const { appService } = useEnv(); | |
| return ( | |
| <button | |
| className={clsx( | |
| 'btn btn-ghost h-8 min-h-8 w-8 p-0', | |
| appService?.isMobileApp && 'hover:bg-transparent', | |
| disabled && 'cursor-default !bg-transparent opacity-50', | |
| className, | |
| )} | |
| title={label} | |
| aria-label={label} | |
| onClick={disabled ? undefined : onClick} | |
| > | |
| {icon} | |
| </button> | |
| ); | |
| }; | |
| export default Button; | |