import * as React from "react";
import StartScreen from "./StartScreen"
import GameScreen from "./GameScreen"
import LevelSelectScreen from "./LevelSelectScreen"
import { Provider } from "react-redux";
// import { BrowserRouter as Router, Route } from 'react-router-dom'
import { HashRouter as Router, Routes, Route } from 'react-router-dom'

const Root = ({ store }) => (
    <Provider store={store}>
        <Router>
            <Routes>
                <Route path="/" element={<StartScreen />} />
                <Route path="/levels" element={<LevelSelectScreen />} />
                <Route path="/level/:name" element={<GameScreen />} />
            </Routes>
        </Router>
    </Provider>
)

// const Root = ({ screen }) => {
//     switch (screen) {
//         case SET_STARTSCREEN:
//             return <StartScreen></StartScreen>;
//         case SET_LEVELSELECTSCREEN:
//             return <LevelSelectScreen></LevelSelectScreen>;
//         default:
//             return <StartScreen></StartScreen>;
//     }
// }



// const mapStateToProps = (state: AppState) => {
//     return {
//         screen: state.screen
//     }
// }

// const mapDispatchToProps = dispatch => {
//     return
// }

export default Root
