import { AnyAction } from '@reduxjs/toolkit'
import React, { Dispatch } from 'react'
import { connect } from 'react-redux'
import { navigateToHomeScreen } from '../App.actions'
import SecondScreenComponent from '../components/SecondScreen'

interface Props {
  onNextPressed: () => void
}

const SecondScreen: React.FunctionComponent<Props> = ({ onNextPressed }) => {
  return <SecondScreenComponent onNextPressed={onNextPressed} />
}

const mapDispatchToProps = (dispatch: Dispatch<AnyAction>) => ({
  onNextPressed: () => {
    dispatch(navigateToHomeScreen())
  },
})

export default connect(null, mapDispatchToProps)(SecondScreen)
