{"size": 604, "ext": "js", "max_stars_repo_path": "frontend/src/RobotItem.js", "max_stars_repo_name": "waynewu6250/ChatBoxer", "max_stars_repo_stars_event_min_datetime": "2019-04-18T14:40:37.000Z", "max_stars_repo_stars_event_max_datetime": "2021-05-11T08:36:21.000Z", "max_issues_repo_path": "frontend/src/RobotItem.js", "max_issues_repo_name": "waynewu6250/ChatBoxer", "max_issues_repo_issues_event_min_datetime": "2020-06-05T20:20:50.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-10T17:48:56.000Z", "max_forks_repo_path": "frontend/src/RobotItem.js", "max_forks_repo_name": "waynewu6250/ChatBoxer", "max_forks_repo_forks_event_min_datetime": "2019-04-28T15:00:31.000Z", "max_forks_repo_forks_event_max_datetime": "2019-08-16T08:50:26.000Z"}
{"max_stars_count": 7, "max_issues_count": 6, "max_forks_count": 2, "avg_line_length": 25.1666666667, "max_line_length": 64, "alphanum_fraction": 0.6589403974}
import React, { useContext } from 'react'
import { Image } from 'semantic-ui-react'
import { MessageManger } from './MessageProvider'

export default function RobotItem(props){
	const dispatch = useContext(MessageManger)[2][1]
	function hanldeStateChange(data = props.data){
		dispatch({ type: data.action, data })
	}
	return (
		<div onClick={() => hanldeStateChange()} className='side_box'>
			<div>
				<Image src={props.data.icon} />
				<span className='online_icon' />
			</div>

			<div className='robot_box'>
				<div>{props.data.title}</div>
				<p>{props.data.info}</p>
			</div>
		</div>
	)
}
