import { render } from "preact";
import { LocationProvider, Router, Route } from "preact-iso";
import { Header } from "./components/header/Header";
import { Footer } from "./components/footer/Footer";
import { Home } from "./pages/Home/index.jsx";
import { ProductDetail } from "./pages/product/ProductDetail";
import { NotFound } from "./pages/_404.jsx";

export function App() {
  return (
    <LocationProvider>
      <main>
        <Header />
        <Router>
          <Route path="/" component={Home} />
          <Route path="/product-detail" component={ProductDetail} />
          <Route default component={NotFound} />
        </Router>
        <Footer />
      </main>
    </LocationProvider>
  );
}

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