import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import "./index.css";
import App from "./App";
import ProductPage from "./components/ProductPage";
import CheckoutPage from "./components/CheckoutPage";
import { CartProvider } from "./store/cart";

createRoot(document.getElementById("root")!).render(
  <StrictMode>
    <BrowserRouter>
      <CartProvider>
        <Routes>
          <Route path="/" element={<App />} />
          <Route path="/checkout" element={<CheckoutPage />} />
          <Route path="/:slug" element={<ProductPage />} />
          <Route path="/:slug/" element={<ProductPage />} />
        </Routes>
      </CartProvider>
    </BrowserRouter>
  </StrictMode>
);
