import React from 'react';
import classnames from 'classnames';

class Panel extends React.Component {
  render = () => {
    if (this.props.component === null) {
      return <div></div>;
    }

    var className = classnames('row', this.props.topClassName);

    return (
      <div className={className}>
        <div className="box offset-1 col-10">
          <div className="row">
            <div className="col-12 panel-title">{this.props.title}</div>
          </div>
          <hr/>
          {this.props.component}
        </div>
      </div>);
    }
}

export default Panel;
