woocommerce/plugins/woocommerce-blocks/packages/components/textarea/index.tsx

39 lines
697 B
TypeScript
Raw Normal View History

/**
* External dependencies
*/
import classnames from 'classnames';
/**
* Internal dependencies
*/
import './style.scss';
interface TextareaProps {
className?: string;
disabled: boolean;
onTextChange: ( newText: string ) => void;
placeholder: string;
value: string;
}
export const Textarea = ( {
className = '',
disabled = false,
onTextChange,
placeholder,
value = '',
}: TextareaProps ): JSX.Element => (
<textarea
className={ classnames( 'wc-block-components-textarea', className ) }
disabled={ disabled }
onChange={ ( event ) => {
onTextChange( event.target.value );
} }
placeholder={ placeholder }
rows={ 2 }
value={ value }
/>
);
export default Textarea;