{"size": 472, "ext": "js", "max_stars_repo_path": "src/components/TreeView/index.js", "max_stars_repo_name": "jtasek/slick", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/TreeView/index.js", "max_issues_repo_name": "jtasek/slick", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/TreeView/index.js", "max_forks_repo_name": "jtasek/slick", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.5217391304, "max_line_length": 70, "alphanum_fraction": 0.6016949153}
import React from 'react'
import styles from 'styles.css'

const TreeNode = ({node}) => (
	<li class="checked">
		<label>{node.title}</label>
		{node.components ? <TreeNodeList nodes={node.components} /> : null}
	</li>
)

const TreeNodeList = ({nodes}) => (
	<ul>
		{nodes.map(x => <TreeNode node={x} />)}
	</ul>
)

const TreeView = ({nodes}) => (
	<div className={styles.treeView}>
		<TreeNodeList nodes={nodes} />
	</div>
)

export default TreeView