import React from 'react'
import {selectVariables, selectTagStats} from '../selectors'
import {connect} from 'react-redux'
import {bindActionCreators} from 'redux'
import * as actions from '../actions'
const Variable = ({data: {variable, tags}}) =>
{variable}
{Object.keys(tags).map(name => -
{name + ': ' + tags[name]}
)}
class Explorer extends React.Component {
render() {
let {tags, actions, variables} = this.props
return (
Les prélèvements sociaux sur les salaires
{variables.map((v, i) => )}
)
}
}
class TagSelect extends React.Component {
render(){
let {tag: {name, choices, number}, selectTag} = this.props
return (
{`${name} (${number} variables)`}
{[...choices].map(c =>
- selectTag(name, c)}>
{c}
)}
)
}
}
const mapStateToProps = state => (
{
variables: selectVariables(state),
tags: selectTagStats(state)
}
)
const actionsToProps = dispatch => ({
actions: bindActionCreators(actions, dispatch),
})
const VariableExplorer = connect(mapStateToProps, actionsToProps)(Explorer)
export default VariableExplorer