import React from 'react' import './Controls.css' import emoji from 'react-easy-emoji' import { connect } from 'react-redux' import { startConversation, hideControl } from 'Actions/actions' import { makeJsx } from 'Engine/evaluation' import { createMarkdownDiv } from 'Engine/marked' import withColours from './utils/withColours' import withLanguage from 'Components/utils/withLanguage' function Controls({ blockingInputControls, controls, startConversation, hideControl, foldedSteps, colours, hiddenControls, language }) { /* TODO controls are not translated yet, since our translation system doesn't handle nested yaml properties of base.yaml */ if (language === 'en') return blockingInputControls?.[0]?.message == 'Entrez un salaire mensuel' ? (

Enter a monthly salary.

) : null return (
{blockingInputControls && (

{blockingInputControls[0].message}

)} {!blockingInputControls && ( <> )}
) } export default connect( (state, props) => ({ foldedSteps: state.conversationSteps.foldedSteps, key: props.language, hiddenControls: state.hiddenControls }), dispatch => ({ startConversation: cible => dispatch(startConversation(cible)), hideControl: id => dispatch(hideControl(id)) }) )(withColours(withLanguage(Controls)))