Download wp-calypso/client/components/forms/form-select/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 727 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/form-select/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/forms/form-select/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/forms/form-select/index.tsx
727 Bytes
| import clsx from 'clsx'; | |
| import { Component } from 'react'; | |
| import type { LegacyRef, HTMLProps } from 'react'; | |
| import './style.scss'; | |
| export interface FormSelectProps { | |
| inputRef?: LegacyRef< HTMLSelectElement >; | |
| className?: string; | |
| isError?: boolean; | |
| } | |
| class FormSelect extends Component< | |
| FormSelectProps & Omit< HTMLProps< HTMLSelectElement >, 'ref' > | |
| > { | |
| static defaultProps = { | |
| isError: false, | |
| }; | |
| render() { | |
| const { inputRef, className, isError, ...props } = this.props; | |
| const classes = clsx( className, 'form-select', { | |
| 'is-error': isError, | |
| } ); | |
| return ( | |
| <select { ...props } ref={ inputRef } className={ classes }> | |
| { this.props.children } | |
| </select> | |
| ); | |
| } | |
| } | |
| export default FormSelect; | |