Download react-page/packages/editor/src/ui/uniform-mui/wrapField.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 837 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/packages/editor/src/ui/uniform-mui/wrapField.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-page/packages/editor/src/ui/uniform-mui/wrapField.tsx
-
curl -L -o wrapField.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-page/packages/editor/src/ui/uniform-mui/wrapField.tsx
837 Bytes
| import FormControl from '@mui/material/FormControl'; | |
| import FormHelperText from '@mui/material/FormHelperText'; | |
| import type { ReactNode } from 'react'; | |
| import React, { createElement } from 'react'; | |
| export default function wrapField( | |
| { | |
| component, | |
| disabled, | |
| error, | |
| errorMessage, | |
| fullWidth, | |
| helperText, | |
| margin, | |
| readOnly, | |
| required, | |
| showInlineError, | |
| variant, | |
| }: any, | |
| ...children: ReactNode[] | |
| ) { | |
| const formHelperText = showInlineError && error ? errorMessage : helperText; | |
| const props = { | |
| component, | |
| disabled: !!disabled, | |
| error: !!error, | |
| fullWidth: !!fullWidth, | |
| margin, | |
| readOnly, | |
| required, | |
| variant, | |
| }; | |
| return createElement( | |
| FormControl, | |
| props, | |
| ...children, | |
| !!formHelperText && <FormHelperText>{formHelperText}</FormHelperText> | |
| ); | |
| } | |