Skip to content

Instantly share code, notes, and snippets.

@zi-gae
Created April 6, 2025 13:09
Show Gist options
  • Save zi-gae/7c24edfbb74272d9b075bfedf866a3d2 to your computer and use it in GitHub Desktop.
Save zi-gae/7c24edfbb74272d9b075bfedf866a3d2 to your computer and use it in GitHub Desktop.
import * as React from "react";
import { Outlet } from "react-router-dom";
import type { RouteObject } from "react-router-dom";
import { AuthGuard } from "@/components/auth/supabase/auth-guard";
import { Layout as DashboardLayout } from "@/components/dashboard/layout/layout";
export const route: RouteObject = {
path: "dashboard",
element: (
<AuthGuard>
<DashboardLayout>
<Outlet />
</DashboardLayout>
</AuthGuard>
),
children: [
{
index: true,
lazy: async () => {
const { Page } = await import("@/pages/dashboard/overview");
return { Component: Page };
},
},
{
path: "blank",
lazy: async () => {
const { Page } = await import("@/pages/dashboard/blank");
return { Component: Page };
},
},
],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment