Skip to content

Commit cf7f675

Browse files
committed
return suspense
1 parent 44fa629 commit cf7f675

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

apps/dashboard/app/layout.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import "./globals.css";
22

33
import { Databuddy } from "@databuddy/sdk/react";
4+
import { SpinnerIcon } from "@phosphor-icons/react/dist/ssr";
45
import type { Metadata, Viewport } from "next";
56
import { Geist, Geist_Mono } from "next/font/google";
7+
import { Suspense } from "react";
68
import { Toaster } from "@/components/ui/sonner";
79
import Providers from "./providers";
810

@@ -130,7 +132,15 @@ export default function RootLayout({
130132
/>
131133
<body className="flex h-full min-h-screen flex-col bg-background text-foreground antialiased">
132134
<Providers>
133-
<main className="flex-1">{children}</main>
135+
<Suspense
136+
fallback={
137+
<div className="flex h-full items-center justify-center p-8">
138+
<SpinnerIcon className="size-8 animate-spin text-primary" />
139+
</div>
140+
}
141+
>
142+
<main className="flex-1">{children}</main>
143+
</Suspense>
134144
</Providers>
135145
<Toaster />
136146
</body>

0 commit comments

Comments
 (0)