{"size": 644, "ext": "js", "max_stars_repo_path": "src/editor/toolBar/sideToolBar.js", "max_stars_repo_name": "dulajra/Z-Editor", "max_stars_repo_stars_event_min_datetime": "2017-08-05T08:39:41.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-23T00:54:00.000Z", "max_issues_repo_path": "src/editor/toolBar/sideToolBar.js", "max_issues_repo_name": "dulajra/Z-Editor", "max_issues_repo_issues_event_min_datetime": "2017-10-05T16:24:50.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T10:01:22.000Z", "max_forks_repo_path": "src/editor/toolBar/sideToolBar.js", "max_forks_repo_name": "dulajra/Z-Editor", "max_forks_repo_forks_event_min_datetime": "2017-08-05T10:39:43.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-09T12:51:02.000Z"}
{"max_stars_count": 113, "max_issues_count": 26, "max_forks_count": 42, "avg_line_length": 23.8518518519, "max_line_length": 118, "alphanum_fraction": 0.647515528}
import React, { Component } from 'react';
import { string, func, array } from 'prop-types';
import SideToolBarBtn from './sideToolBarBtn';

class SideToolBar extends Component {
  static propTypes = {
    data: array.isRequired,
    side: string,
    insertFn: func
  };

  constructor(props) {
    super(props);

    this.state = {
      btns: this.props.data
    };
  }

  render() {
    const { side, insertFn } = this.props;
    const bt = this.state.btns.map(btn => <SideToolBarBtn type={btn} side={side} key={btn.id} insertFn={insertFn} />);
    return <ul className="rdw-editor-toolbar-side">{bt}</ul>;
  }
}
export default SideToolBar;
