mon-entreprise/containers/Explorer.js

29 lines
554 B
JavaScript
Raw Normal View History

2016-06-29 10:27:04 +00:00
import React from 'react'
2016-06-30 10:16:47 +00:00
import data from '../model'
console.log(data)
2016-06-29 10:27:04 +00:00
export default class Explorer extends React.Component {
render() {
2016-06-29 16:57:56 +00:00
return (
<ul id="tags">
2016-06-30 10:16:47 +00:00
{data.map(tag =>
<TagSelect key={tag.name} tag={tag} />
2016-06-29 16:57:56 +00:00
)}
</ul>
)
2016-06-29 10:27:04 +00:00
}
}
2016-06-30 10:16:47 +00:00
class TagSelect extends React.Component {
render(){
let {name, choices, number} = this.props.tag
return (<li>
<span className="name">{`${name} (${number} variables)`}</span>
<ul className="choices">
{[...choices].map(c => <li key={c}>
{c}
</li>)}
</ul>
</li>)
}
}