import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import * as App from './App';
import * as serviceWorker from './serviceWorker';
import * as state from './state'
import { HashRouter, Redirect, Route, Link, BrowserRouter as Router } from 'react-router-dom'
import { Provider } from 'react-redux'
import { StateLoader } from './loader'
import * as Shared from 'placeholder-shared'
import * as Login from './Login'

import * as Loader from './loader'
import * as Sheet from './Sheet'
//const e = require('electron')

class Auth extends React.Component {
	constructor(props) {
		super(props)
	}

	componentDidMount = () => {
	}
	render() {
		return <div>
			</div>
	}

}

class Test extends React.Component {
	constructor(props) {
		super(props)
	}
	render() {
		return <div>Hello</div>

	}
}
function getRouting() {
	var RouterType
	if (false) {
		console.log("using hash router")
		RouterType = Router
	}
	else {
		RouterType = Router
	}
	let routing = (
			<RouterType> 
			<Route exact path="/auth" component={Auth}/>
			<Route exact path="/account/login" component={Login.StateLogin} />
			<Route exact path="/account/register" component={Login.StateRegister} />
			<Route exact path="/account/verify" component={Login.StateVerify} />
			<Route exact path="/account/logout" component={Login.StateLogout} />
			<Route exact path="/account/forgot" component={Login.StateForgot} />
			<Route exact path="/account/reset" component={Login.StateReset} />

			{/*<Route exact path="/account/demo" component={Demo.CreateDemo} />
				<Route path="/app" component={StateMyHeader}/>*/}
			{/*<Route exact path="/app/home" component={StateDashHome} />
			<Route exact path="/app/results" component={StateResults} />
			<Route exact path="/app/test" component={StateTester} />
	*/}
			<Route exact path="/app/editor/" component={App.StateApp} />
			<Route exact path="/app/sheets/" component={Sheet.Sheet} />
			<Route exact path="/app/editor/:taskID" component={App.StateApp} />
			</RouterType>
		      )
	return routing
}

ReactDOM.render(getRouting(), document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();


