/* @flow */ import { startConversation } from 'Actions/actions' import withLanguage from 'Components/utils/withLanguage' import { compose, toPairs } from 'ramda' import React from 'react' import { Trans } from 'react-i18next' import { connect } from 'react-redux' import { withRouter } from 'react-router' import { animated, Spring } from 'react-spring' import { validInputEnteredSelector } from 'Selectors/analyseSelectors' import type { Location } from 'react-router' type Props = { startConversation: (?string) => void, location: Location, validInputEntered: boolean } let quickLinks = { CDD: 'contrat salarié . type de contrat', Cadre: 'contrat salarié . statut cadre', 'Temps partiel': 'contrat salarié . temps partiel', Localisation: 'établissement . localisation', Autres: null } const QuickLink = ({ startConversation, location, validInputEntered }: Props) => { const show = !location.pathname.endsWith('/simulation') && validInputEntered return ( {styles => ( {toPairs(quickLinks).map(([label, dottedName]) => ( ))} )} ) } export default compose( withLanguage, withRouter, connect( (state, props) => ({ key: props.language, validInputEntered: validInputEnteredSelector(state) }), { startConversation } ) )(QuickLink)