2024-08-14 15:36:25 +07:00
|
|
|
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
2024-08-16 01:23:55 +07:00
|
|
|
import { lazy } from "react";
|
2024-08-14 15:36:25 +07:00
|
|
|
import AuthLayout from "@/components/layouts/auth-layout";
|
|
|
|
import MainLayout from "@/components/layouts/main-layout";
|
2024-08-16 01:23:55 +07:00
|
|
|
|
|
|
|
const ClusterPage = lazy(() => import("@/pages/cluster/page"));
|
|
|
|
const HomePage = lazy(() => import("@/pages/home/page"));
|
|
|
|
const BucketsPage = lazy(() => import("@/pages/buckets/page"));
|
|
|
|
const ManageBucketPage = lazy(() => import("@/pages/buckets/manage/page"));
|
2024-08-14 15:36:25 +07:00
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
{
|
|
|
|
path: "/auth",
|
|
|
|
Component: AuthLayout,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "/",
|
|
|
|
Component: MainLayout,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
index: true,
|
|
|
|
Component: HomePage,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "cluster",
|
|
|
|
Component: ClusterPage,
|
|
|
|
},
|
2024-08-16 01:23:55 +07:00
|
|
|
{
|
|
|
|
path: "buckets",
|
|
|
|
children: [
|
|
|
|
{ index: true, Component: BucketsPage },
|
|
|
|
{ path: ":id", Component: ManageBucketPage },
|
|
|
|
],
|
|
|
|
},
|
2024-08-14 15:36:25 +07:00
|
|
|
],
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
|
|
|
|
const Router = () => {
|
|
|
|
return <RouterProvider router={router} />;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Router;
|