fix(map): use component-level loading skeletons

This commit is contained in:
2026-07-30 13:21:55 +08:00
parent c4246cf25f
commit 1d7e07174f
28 changed files with 1095 additions and 264 deletions
+3 -6
View File
@@ -1,11 +1,10 @@
import type { Metadata } from "next";
import { cookies } from "next/headers";
import React, { Suspense } from "react";
import type { ReactNode } from "react";
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";
@@ -20,7 +19,7 @@ export const metadata: Metadata = META_DATA;
export default async function MainLayout({
children,
}: Readonly<{
children: React.ReactNode;
children: ReactNode;
}>) {
const cookieStore = await cookies();
const theme = cookieStore.get("theme");
@@ -49,9 +48,7 @@ export default async function MainLayout({
sx: { height: "100vh", overflow: "hidden" },
}}
>
<Suspense fallback={<MapSkeleton />}>
{children}
</Suspense>
{children}
</ThemedLayout>
);
}