import _ from "./env";
import { render } from "preact";
import { LocationProvider, Router, Route } from "preact-iso";

import { Header } from "./components/Header.jsx";
import { CalendarOptimizer } from "./pages/CalendarOptimizer.js";
import { NotFound } from "./pages/_404.jsx";
// import './style.css';
import { HistoricalCalendarPrices } from "./pages/HistoricalCalendarPrices.js";

export function App() {
  return (
    <LocationProvider>
      <div class="flex flex-col justify-start gap-4">
        <Header />
        <main>
          <Router>
            <Route path="/" component={HistoricalCalendarPrices} />
            <Route path="/calendar-optimizer" component={CalendarOptimizer} />
            <Route
              path="/historical-calendar-prices"
              component={HistoricalCalendarPrices}
            />
            <Route default component={NotFound} />
          </Router>
        </main>
      </div>
    </LocationProvider>
  );
}

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