import React, {Component} from 'react' import {connect} from 'react-redux' import {findRuleByName} from '../engine/rules' import './Aide.css' import {EXPLAIN_VARIABLE} from '../actions' @connect( state => ({explained: state.explainedVariable}), dispatch => ({ stopExplaining: () => dispatch( {type: EXPLAIN_VARIABLE}) }) ) export default class Aide extends Component { render() { let {explained, stopExplaining} = this.props if (!explained) return
let rule = findRuleByName(explained), text = rule.description || rule.titre let possibilities = rule['choix exclusifs'] return (

{text}

{ possibilities &&

{possibilities.length} possibilités :

}
) } }