Download apps/readest-app/src/components/Menu.tsx from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 724 Bytes
-
https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/components/Menu.tsx
- Command line
-
hf download hf://datasets/echodict/readest/apps/readest-app/src/components/Menu.tsx
-
curl -L -o Menu.tsx https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/components/Menu.tsx
724 Bytes
| import clsx from 'clsx'; | |
| import React, { useRef } from 'react'; | |
| import { useKeyDownActions } from '@/hooks/useKeyDownActions'; | |
| interface MenuProps { | |
| children: React.ReactNode; | |
| className?: string; | |
| style?: React.CSSProperties; | |
| onCancel?: () => void; | |
| } | |
| const Menu: React.FC<MenuProps> = ({ children, className, style, onCancel }) => { | |
| const menuRef = useRef<HTMLDivElement | null>(null); | |
| useKeyDownActions({ onCancel, elementRef: menuRef }); | |
| return ( | |
| <div | |
| ref={menuRef} | |
| role='none' | |
| className={clsx( | |
| 'menu-container max-h-[calc(100vh-96px)] overflow-y-auto border-0', | |
| className, | |
| )} | |
| style={style} | |
| > | |
| {children} | |
| </div> | |
| ); | |
| }; | |
| export default Menu; | |