import React, { useEffect } from "react";
import { useIsConnected } from "./hooks/useIsConnected";
import { Route, Routes } from "react-router";
import { Departure } from "./components/Home/Departure";
import { Arrival } from "./components/Home/Arrival";
import { Home } from "./components/Home/Home";
import { Button } from "antd";
import { initDB } from "./db";

function App() {
	const connection = useIsConnected();
    // initDB();

	return (
		<div className="App">
			<Routes>
				<Route path="/departure" element={<Departure/>} />
				<Route path="/arrival" element={<Arrival/>} />
				<Route path="/" element={<Home/>} />
			</Routes>
			<div className="FloatingStatus">{connection}</div>
		</div>
	);
}

export default App;
