/* @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 = { tracker: Tracker, displayResults: boolean } const resultViewTitle = { distribution: 'Cotisations', payslip: 'Fiche de paie' } export default class SalaryCompactExplanation extends Component { state = { resultView: 'payslip' } handleClickOnTab = (resultView: ResultView) => () => { this.setState({ resultView }) this.props.tracker.push(['trackEvent', 'results', 'selectView', resultView]) } render() { return ( <>
{['payslip', 'distribution'].map(resultView => ( ))}
{this.state.resultView === 'payslip' ? : }
) } }