Download wp-calypso/client/components/forms/form-radio/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 619 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/form-radio/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/forms/form-radio/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/form-radio/index.tsx
619 Bytes
| import clsx from 'clsx'; | |
| import type { HTMLProps, ReactNode } from 'react'; | |
| import './style.scss'; | |
| const FormRadio = ( { | |
| className, | |
| label, | |
| htmlFor, | |
| ...otherProps | |
| }: { | |
| className?: string; | |
| label?: ReactNode; | |
| htmlFor?: string; | |
| } & Omit< HTMLProps< HTMLInputElement >, 'label' > ) => ( | |
| <> | |
| <input { ...otherProps } type="radio" className={ clsx( className, 'form-radio' ) } /> | |
| { label && ! htmlFor && <span className="form-radio__label">{ label }</span> } | |
| { label && htmlFor && ( | |
| <label className="form-radio__label" htmlFor={ htmlFor }> | |
| { label } | |
| </label> | |
| ) } | |
| </> | |
| ); | |
| export default FormRadio; | |