1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-08 16:26:45 +00:00
mon-entreprise/source/components/ProgressTip.js

32 lines
765 B
JavaScript
Raw Normal View History

import React, { Component } from 'react'
import { Trans } from 'react-i18next'
2017-12-20 16:21:29 +01:00
import { connect } from 'react-redux'
import { nextStepsSelector } from 'Selectors/analyseSelectors'
import './ProgressTip.css'
export default connect(state => ({
nextSteps: nextStepsSelector(state)
}))(
class ProgressTip extends Component {
render() {
let { nextSteps } = this.props,
nbQuestions = nextSteps.length
if (nbQuestions === 0) return null
2018-03-12 10:38:29 +01:00
return (
<div className="progressTip">
<p>
{nbQuestions === 1 ? (
<Trans i18nKey="lastQ">dernière question !</Trans>
) : (
<Trans i18nKey="questionsLeft" count={nbQuestions}>
moins de {{ nbQuestions }} questions
</Trans>
)}
</p>
</div>
)
}
}
)