Download react-page/packages/editor/src/ui/SelectParentButton/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 746 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/packages/editor/src/ui/SelectParentButton/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-page/packages/editor/src/ui/SelectParentButton/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/packages/editor/src/ui/SelectParentButton/index.tsx
746 Bytes
| import IconButton from '@mui/material/IconButton'; | |
| import VerticalAlignTopIcon from '@mui/icons-material/VerticalAlignTop'; | |
| import React from 'react'; | |
| import { | |
| useFocusCell, | |
| useParentCellId, | |
| useUiTranslator, | |
| } from '../../core/components/hooks'; | |
| export const SelectParentButton: React.FC<{ | |
| nodeId: string; | |
| }> = React.memo(({ nodeId }) => { | |
| const parentCellId = useParentCellId(nodeId); | |
| const { t } = useUiTranslator(); | |
| const focusParent = useFocusCell(parentCellId); | |
| return parentCellId ? ( | |
| <IconButton | |
| className="bottomToolbar__selectParentButton" | |
| onClick={() => focusParent()} | |
| color="default" | |
| title={t('Select parent') ?? ''} | |
| > | |
| <VerticalAlignTopIcon /> | |
| </IconButton> | |
| ) : null; | |
| }); | |