{"size": 1173, "ext": "js", "max_stars_repo_path": "client/coral-embed-stream/src/tabs/stream/components/DraftAreaContent.js", "max_stars_repo_name": "richardvenneman/talk", "max_stars_repo_stars_event_min_datetime": "2020-06-12T11:04:58.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-09T04:56:50.000Z", "max_issues_repo_path": "client/coral-embed-stream/src/tabs/stream/components/DraftAreaContent.js", "max_issues_repo_name": "richardvenneman/talk", "max_issues_repo_issues_event_min_datetime": "2018-01-12T11:15:25.000Z", "max_issues_repo_issues_event_max_datetime": "2018-02-13T12:38:04.000Z", "max_forks_repo_path": "client/coral-embed-stream/src/tabs/stream/components/DraftAreaContent.js", "max_forks_repo_name": "richardvenneman/talk", "max_forks_repo_forks_event_min_datetime": "2017-11-22T03:01:28.000Z", "max_forks_repo_forks_event_max_datetime": "2017-11-22T03:01:28.000Z"}
{"max_stars_count": 2, "max_issues_count": 2, "max_forks_count": 1, "avg_line_length": 22.5576923077, "max_line_length": 75, "alphanum_fraction": 0.5967604433}
import React from 'react';
import PropTypes from 'prop-types';
import cn from 'classnames';
import styles from './DraftAreaContent.css';

class DraftAreaContent extends React.Component {
  render() {
    const {
      input,
      id,
      onInputChange,
      disabled,
      label,
      placeholder,
    } = this.props;
    const inputId = `${id}-textarea`;
    return (
      <div>
        <label
          htmlFor={inputId}
          className="screen-reader-text"
          aria-hidden={true}
        >
          {label}
        </label>
        <textarea
          id={inputId}
          className={cn(styles.content, 'talk-plugin-commentbox-textarea')}
          value={input.body}
          placeholder={placeholder}
          onChange={e => onInputChange({ body: e.target.value })}
          rows={3}
          disabled={disabled}
        />
      </div>
    );
  }
}

DraftAreaContent.propTypes = {
  id: PropTypes.string,
  input: PropTypes.object,
  placeholder: PropTypes.string,
  label: PropTypes.string,
  onInputChange: PropTypes.func,
  disabled: PropTypes.bool,
  isEdit: PropTypes.bool,
  isReply: PropTypes.bool,
};

export default DraftAreaContent;
