{"size": 642, "ext": "js", "max_stars_repo_path": "assets/js/components/Panel/index.js", "max_stars_repo_name": "alextishin/react_ui_components", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "assets/js/components/Panel/index.js", "max_issues_repo_name": "alextishin/react_ui_components", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "assets/js/components/Panel/index.js", "max_forks_repo_name": "alextishin/react_ui_components", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.4, "max_line_length": 67, "alphanum_fraction": 0.6028037383}
import React, {Component} from 'react'
import './style.css'

class Panel extends Component {
  
  static propTypes = {
    headerText: React.PropTypes.string,
    header: React.PropTypes.boolean
  }
  
  isHeaderVisible() {
    return !this.props.header ? "hidden" : "";
  }

  render() {
    return (
      <div className="panel" style={this.props.styles}>
        <div className={`panel__header ${this.isHeaderVisible()}`}>
          <h2 className="panel__title">{this.props.headerText}</h2>
        </div>
        <div className="panel__body">
          {this.props.children}
        </div>
      </div>
    )
  }
}

export default Panel;
