/* @flow */ import Distribution from 'Components/Distribution'; import PaySlip from 'Components/PaySlip'; import SearchButton from 'Components/SearchButton'; import React, { Component } from 'react'; import { Trans } from 'react-i18next'; import './SalaryCompactExplanation.css'; import type { Tracker } from 'Components/utils/withTracker' type ResultView = 'distribution' | 'payslip'; type State = { resultView: ResultView } type Props = { conversationStarted: boolean, tracker: Tracker, displayResults: boolean } const resultViewTitle = { distribution: 'Cotisations', payslip: 'Fiche de paie' } export default class SalaryCompactExplanation extends Component { state = { resultView: this.props.conversationStarted ? 'payslip' : 'distribution' } handleClickOnTab = (resultView: ResultView) => () => { this.setState({ resultView }) this.props.tracker.push(['trackEvent', 'results', 'selectView', resultView]) } render() { return ( this.props.displayResults && ( <>
{['payslip', 'distribution'].map(resultView => ( ))}
{this.state.resultView === 'payslip' ? ( ) : ( )}
) ) } }