{"size": 565, "ext": "js", "max_stars_repo_path": "todo-list/src/components/Todo.js", "max_stars_repo_name": "alex996/microapps", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "todo-list/src/components/Todo.js", "max_issues_repo_name": "alex996/microapps", "max_issues_repo_issues_event_min_datetime": "2019-10-30T22:36:28.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-25T23:39:21.000Z", "max_forks_repo_path": "todo-list/src/components/Todo.js", "max_forks_repo_name": "alex996/microapps", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 62, "max_forks_count": null, "avg_line_length": 17.1212121212, "max_line_length": 62, "alphanum_fraction": 0.6247787611}
import React from 'react'
import PropTypes from 'prop-types'

const Todo = ({ title, completed, onComplete, onDelete }) => (
  <>
    <input
      type='checkbox'
      value={completed}
      onChange={onComplete}
    />
    <span>{title}</span>
    <button onClick={onDelete}>
      X
    </button>
  </>
)

Todo.onComplete = {
  title: PropTypes.string,
  completed: PropTypes.bool,
  onComplete: PropTypes.func,
  onDelete: PropTypes.func
}

Todo.defaultProps = {
  title: '',
  completed: false,
  onComplete: f => f,
  onDelete: f => f
}

export default Todo
