summaryrefslogtreecommitdiff
path: root/src/main.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.tsx')
-rw-r--r--src/main.tsx25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/main.tsx b/src/main.tsx
index 91c03f3..891dd4b 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,10 +1,27 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
-import App from './App.tsx'
+import { createBrowserRouter, Navigate, RouterProvider } from 'react-router-dom'
+import Products from "./routes/products/products";
+import Layout from "./components/layout";
import './index.css'
+const routes = [
+ {
+ path: '/products',
+ element: <Products/>
+ },
+ {
+ path: '/',
+ element: <Navigate to='/products'/>
+ }
+];
+
+const router = createBrowserRouter(routes);
+
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
- <App />
- </React.StrictMode>,
-)
+ <Layout>
+ <RouterProvider router={router}/>
+ </Layout>
+ </React.StrictMode>
+) \ No newline at end of file