import ReactDOM from 'react-dom/client';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import './App.css';
import NavBar from './helper/NavBar';
import Home from './pages/Home';
import NoPage from './pages/NoPage';
import Product from './pages/Product';
import Payment from './pages/Payment';
import { BasketProvider } from './helper/BasketProvider';

export default function App() {

  return (
    <BasketProvider>
      <BrowserRouter>
        <NavBar />
        <Routes>
          <Route path="/" element={<Home />} />
          <Route path="*" element={<NoPage />} />
          <Route path="/product/:id" element={<Product />} />
          <Route path="/payment" element={<Payment />} />
        </Routes>
      </BrowserRouter>
    </BasketProvider>
  )
}

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(<App />);
