{"size": 790, "ext": "js", "max_stars_repo_path": "src/components/Button/Button.js", "max_stars_repo_name": "muhammetarikaya/react-ui-1", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/Button/Button.js", "max_issues_repo_name": "muhammetarikaya/react-ui-1", "max_issues_repo_issues_event_min_datetime": "2020-08-12T22:28:11.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-22T09:52:18.000Z", "max_forks_repo_path": "src/components/Button/Button.js", "max_forks_repo_name": "muhammetarikaya/react-ui-1", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 23.2352941176, "max_line_length": 64, "alphanum_fraction": 0.6392405063}
import React from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import PropTypes from 'prop-types';
import s from './Button.css';

class TurkcellButton extends React.Component {
  static props = {
    children: PropTypes.node.isRequired,
    icon: PropTypes.string,
    onClick: PropTypes.func,
  };

  handleClick = event => {
    if (this.props.onClick) {
      this.props.onClick(event);
    }

    event.preventDefault();
  };

  render() {
    return (
      <div onClick={this.handleClick} className={s.blueAddBtn}>
        <div className={s.icon}
          style={{backgroundImage: 'url('+this.props.icon+')'}}
        />
        <div className={s.text}>{this.props.children}</div>
      </div>
    );
  }
}

export default withStyles(s)(TurkcellButton);
