/**
*
* IKInputGroup
*
*/

import React, { PureComponent } from 'react';


class IKInputGroup extends PureComponent { // eslint-disable-line react/prefer-stateless-function
  static propTypes = {
    title: React.PropTypes.string,
    position: React.PropTypes.string,
    className: React.PropTypes.string,
  };

  constructor(props) {
    super(props);
  }

  render() {
    const props = $.extend({}, this.props);
    let className = 'ikmd-input-group-container';
    let groupClassName = '';
    let titleArea = null;

    if (props.title) {
      titleArea = (<div className="ikmd-input-group-header">{props.title}</div>)
    }

    if (props.position) {
      groupClassName = `ikmd-input-group-${props.position}`;
    }

    if (props.className) {
      className += ` ${props.className}`;
    }

    return (
      <div className={className}>
        <div className="ikmd-input-group">
          {titleArea}
          {props.children}
        </div>
      </div>
    );
  }
}

export default IKInputGroup;
