Lazy load notification and keep-online providers

Introduced NotificationProviderWrapper to dynamically load the notification context only on dashboard pages, reducing initial bundle size. KeepOnline component is now also lazy-loaded. Updated app layout to use the new wrapper.
This commit is contained in:
g
2025-12-31 07:11:10 +00:00
parent 2777cfda0b
commit 37a8cfed82
4 changed files with 47 additions and 8 deletions

View File

@@ -1,7 +1,12 @@
"use client";
import { usePathname } from "next/navigation";
import KeepOnline from "@/components/KeepOnline";
import dynamic from "next/dynamic";
// Lazy load KeepOnline component - only needed on dashboard pages
const KeepOnline = dynamic(() => import("@/components/KeepOnline"), {
ssr: false,
});
const KeepOnlineWrapper = () => {
const pathname = usePathname();