import React from 'react';
import { HashRouter as Router, Redirect, Route, Switch } from 'react-router-dom';
import NotFound from './components/pages/NotFound';
import Login from './components/pages/Login';
import App from './Layout/App';
import SysAdmin from './Layout/SysAdmin';

export default () => (
    <Router>
        <Switch>
            <Route exact path="/" render={() => <Redirect to="/app/dashboard/index" push/>}/>
            <Route path="/app" component={(props) => <App {...props} />}/>
            <Route path="/sys" component={SysAdmin}/>
            <Route path="/404" component={NotFound}/>
            <Route path="/login" component={(props) => <Login {...props}/>}/>
            <Route component={NotFound}/>
        </Switch>
    </Router>
);
