{"size": 928, "ext": "js", "max_stars_repo_path": "src/components/expense-list/ExpenseIcon.js", "max_stars_repo_name": "jig21nesh/expenses", "max_stars_repo_stars_event_min_datetime": "2019-06-27T13:58:28.000Z", "max_stars_repo_stars_event_max_datetime": "2019-06-27T13:58:28.000Z", "max_issues_repo_path": "src/components/expense-list/ExpenseIcon.js", "max_issues_repo_name": "jdiss/expenses", "max_issues_repo_issues_event_min_datetime": "2020-07-17T05:00:08.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-08T22:48:18.000Z", "max_forks_repo_path": "src/components/expense-list/ExpenseIcon.js", "max_forks_repo_name": "jdiss/expenses", "max_forks_repo_forks_event_min_datetime": "2018-05-18T17:42:55.000Z", "max_forks_repo_forks_event_max_datetime": "2018-05-18T17:42:55.000Z"}
{"max_stars_count": 1, "max_issues_count": 13, "max_forks_count": 1, "avg_line_length": 23.2, "max_line_length": 72, "alphanum_fraction": 0.5668103448}
import React, { Component } from 'react';

export default class ExpenseIcon extends Component {
  iconFrom(category) {
    switch (category) {
      case "Groceries":
        return "local_grocery_store";
      case "Restaurants":
        return "local_dining";
      case "Car":
        return "directions_car";
      case "Hobbies":
        return "local_library";
      case "Household":
        return "home";
      case "Shopping":
        return "local_mall";
      case "Health":
        return "local_hospital";
      case "Entertainment":
        return "local_movies";
      default:
        return "attach_money";
    }
  }

  render() {
    return (
      <span
        className={`mdc-list-item__start-detail ${this.props.category}`}
        role="presentation"
      >
        <i className="material-icons" aria-hidden="true">
          {this.iconFrom(this.props.category)}
        </i>
      </span>
    );
  }
}
