diff --git a/src/app/(main)/layout.tsx b/src/app/(main)/layout.tsx index 08719db..07f97ed 100644 --- a/src/app/(main)/layout.tsx +++ b/src/app/(main)/layout.tsx @@ -6,6 +6,7 @@ import authOptions from "@app/api/auth/[...nextauth]/options"; import { Header } from "@components/header"; import { Title } from "@components/title"; import { MapSkeleton } from "@components/loading/MapSkeleton"; +import { AppSider } from "@components/sider/AppSider"; import { ThemedLayout } from "@refinedev/mui"; import { getServerSession } from "next-auth/next"; import { redirect } from "next/navigation"; @@ -35,6 +36,7 @@ export default async function MainLayout({ - {children} + + {children} + diff --git a/src/components/sider/AppSider.tsx b/src/components/sider/AppSider.tsx new file mode 100644 index 0000000..ec92420 --- /dev/null +++ b/src/components/sider/AppSider.tsx @@ -0,0 +1,17 @@ +"use client"; + +import { ThemedSider, type RefineThemedLayoutSiderProps } from "@refinedev/mui"; + +export const AppSider: React.FC = (props) => { + return ( + ( + <> + {items} + {logout} + + )} + /> + ); +}; diff --git a/src/providers/devtools/index.tsx b/src/providers/devtools/index.tsx index e039bf9..01c4c8d 100644 --- a/src/providers/devtools/index.tsx +++ b/src/providers/devtools/index.tsx @@ -1,16 +1,31 @@ "use client"; -import { - DevtoolsPanel, - DevtoolsProvider as DevtoolsProviderBase, -} from "@refinedev/devtools"; -import React from "react"; +import React, { Suspense } from "react"; + +const RefineDevtools = React.lazy(async () => { + const { DevtoolsPanel, DevtoolsProvider: DevtoolsProviderBase } = + await import("@refinedev/devtools"); + + return { + default: (props: React.PropsWithChildren) => ( + + {props.children} + + + ), + }; +}); export const DevtoolsProvider = (props: React.PropsWithChildren) => { + if (process.env.NODE_ENV !== "development") { + return <>{props.children}; + } + return ( - - {props.children} - - + + + {props.children} + + ); };