import { render } from 'preact';
import { LocationProvider, Router, Route } from 'preact-iso';

import { Header } from './components/Header.jsx';
import { Home } from './pages/Home/index.jsx';
import { NotFound } from './pages/_404.jsx';
import './style.css';
import { useState } from 'preact/hooks';

export function App() {
	const [book, setBook] = useState("Genesis")
	return (
		<LocationProvider>
			<Header book={book} setBook={setBook} />
			<main>
				<Router>
					<Route path="/" component={Home} book={book} setBook={setBook} />
					<Route default component={NotFound} />
				</Router>
			</main>
		</LocationProvider>
	);
}

render(<App />, document.getElementById('app'));
