import React, { HTMLProps } from 'react';
import classnames from 'classnames';
import './Input.scss';
interface State {
hasBlurred: boolean;
/**
* @description when the input has not had any values inputted yet
* e.g. "Pristine" condition
*/
isStateless: boolean;
}
interface OwnProps extends HTMLProps {
isValid: boolean;
showValidAsPlain?: boolean;
}
class TextArea extends React.Component {
public state: State = {
hasBlurred: false,
isStateless: true
};
public render() {
const { showValidAsPlain, isValid, ...htmlProps } = this.props;
const classname = classnames(
this.props.className,
'input-group-input',
this.state.isStateless ? '' : isValid ? (showValidAsPlain ? '' : '') : `invalid`,
this.state.hasBlurred && 'has-blurred'
);
return (