Ivy-Frontend/src/App.tsx
2023-02-27 01:51:50 +08:00

60 lines
1.3 KiB
TypeScript

import React from "react";
import Dashboard from "./Routes/Dashboard/Dashboard";
import Error from "./Routes/Error/Error";
import Products from "./Routes/Products/Products";
import Container from "./Components/Container/Container";
import { createBrowserRouter, RouterProvider } from "react-router-dom";
import Store from "./Plugins/Redux/Store/Store";
import { Provider } from "react-redux";
import Inventory from "./Routes/Inventory/Inventory";
import AddProduct from "./Routes/Products/AddProduct/AddProduct";
const router = createBrowserRouter([
{
path: "/",
element: (
<Container>
<Dashboard />
</Container>
),
errorElement: (
<Container>
<Error />
</Container>
),
},
{
path: "/Products",
element: (
<Container>
<Products />
</Container>
),
},
{
path: "/Inventory",
element: (
<Container>
<Inventory />
</Container>
),
},
{
path: "/Products/AddProduct",
element: (
<Container>
<AddProduct />
</Container>
),
},
]);
export default function App() {
return (
<React.StrictMode>
<Provider store={Store}>
<RouterProvider router={router} />
</Provider>
</React.StrictMode>
);
}