{"size": 401, "ext": "js", "max_stars_repo_path": "client/src/components/ActionButton/index.js", "max_stars_repo_name": "PeteLow-13/FunApp", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "client/src/components/ActionButton/index.js", "max_issues_repo_name": "PeteLow-13/FunApp", "max_issues_repo_issues_event_min_datetime": "2020-11-29T00:39:09.000Z", "max_issues_repo_issues_event_max_datetime": "2020-11-29T00:39:09.000Z", "max_forks_repo_path": "client/src/components/ActionButton/index.js", "max_forks_repo_name": "PeteLow-13/FunApp", "max_forks_repo_forks_event_min_datetime": "2020-11-07T18:12:33.000Z", "max_forks_repo_forks_event_max_datetime": "2021-02-03T04:42:04.000Z"}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": 2, "avg_line_length": 23.5882352941, "max_line_length": 107, "alphanum_fraction": 0.7057356608}
import React from 'react'
import { Link } from 'react-router-dom';

const ActionButton = props => {

  const buttonStyle = {}

  if (props.color) buttonStyle.backgroundColor = props.color;

  const button = <div className="actions__button" style={buttonStyle}>{props.children || 'Favorite'}</div>;

  return props.link ? <Link to={props.link}>{button}</Link> : button;

}

export default ActionButton
