import React, { Component } from 'react'
import './CDD.css'
import IntroCDD from './IntroCDD'
import Results from './Results'
import {reduxForm, formValueSelector} from 'redux-form'
import {connect} from 'react-redux'
import './conversation/conversation.css'
import {START_CONVERSATION} from '../actions'
import {findRuleByName} from '../engine/rules'
@connect(({form: {conversation}, steps, explainTerm}) => ({conversationState: conversation && conversation.values, steps, explainTerm}))
class Aide extends Component {
render() {
let {steps, conversationState, explainTerm} = this.props
if (!steps.length) return null
let [{dependencyOfVariables, helpText}] = steps
if (!explainTerm) return
let rule = findRuleByName(explainTerm),
text = rule.description || rule.titre
let possibilities = rule['choix exclusifs']
return (
{text}
{possibilities.length} possibilités :
{possibilities.map(p =>