/* @flow */ import { deletePreviousSimulation, loadPreviousSimulation } from 'Actions/actions' import { compose } from 'ramda' import React from 'react' import { Trans, withI18n } from 'react-i18next' import { connect } from 'react-redux' import { noUserInputSelector } from 'Selectors/analyseSelectors' import { LinkButton } from 'Ui/Button' import Banner from './Banner' import type { SavedSimulation } from 'Types/State' type ConnectedPropTypes = { previousSimulation: SavedSimulation, loadPreviousSimulation: () => void, newSimulationStarted: boolean, deletePreviousSimulation: () => void } const PreviousSimulationBanner = ({ previousSimulation, deletePreviousSimulation, newSimulationStarted, loadPreviousSimulation }: ConnectedPropTypes) => ( ) export default compose( withI18n(), connect( state => ({ previousSimulation: state.previousSimulation, newSimulationStarted: !noUserInputSelector(state) }), { loadPreviousSimulation, deletePreviousSimulation } ) )(PreviousSimulationBanner)