/* @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 OwnProps = {
quickLinks: {[string]: string},
}
type Props = OwnProps & {
startConversation: (?string) => void,
location: Location,
validInputEntered: boolean,
conversationStarted: boolean
}
const QuickLinks = ({
startConversation,
validInputEntered,
quickLinks,
conversationStarted
}: Props) => {
const show = validInputEntered && !conversationStarted
return (
{styles => (
{toPairs(quickLinks).map(([label, dottedName]) => (
))}
)}
)
}
export default (compose(
withLanguage,
withRouter,
connect(
(state, props) => ({
key: props.language,
validInputEntered: validInputEnteredSelector(state),
conversationStarted: state.conversationStarted,
quickLinks: state.simulation?.config["questions à l'affiche"]
}),
{
startConversation
}
)
)(QuickLinks): React$ComponentType)