2026-07-26 15:34:08 +07:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import { Suspense } from "react";
|
|
|
|
|
|
2026-07-26 16:14:32 +07:00
|
|
|
import { Chatbot } from "@/components/chatbot/chatbot";
|
|
|
|
|
import { AppHeader } from "@/components/layout/app-header";
|
|
|
|
|
import { AppSidebar } from "@/components/layout/app-sidebar";
|
|
|
|
|
import { MobileNav } from "@/components/layout/mobile-nav";
|
2026-07-26 15:34:08 +07:00
|
|
|
import { WsProvider } from "@/lib/ws/context";
|
|
|
|
|
|
|
|
|
|
export default function DashboardLayout({
|
|
|
|
|
children,
|
|
|
|
|
}: {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}) {
|
|
|
|
|
return (
|
|
|
|
|
<WsProvider>
|
2026-07-26 16:14:32 +07:00
|
|
|
<div className="flex h-screen overflow-hidden bg-background">
|
|
|
|
|
<AppSidebar />
|
|
|
|
|
<div className="flex flex-1 flex-col min-w-0">
|
|
|
|
|
<AppHeader />
|
|
|
|
|
<main className="flex-1 overflow-y-auto p-4 md:p-6 pb-20 md:pb-6">
|
|
|
|
|
<Suspense
|
|
|
|
|
fallback={
|
|
|
|
|
<div className="flex h-full items-center justify-center">
|
|
|
|
|
<div className="size-6 animate-spin rounded-full border-2 border-primary border-t-transparent" />
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</Suspense>
|
|
|
|
|
</main>
|
2026-07-26 15:34:08 +07:00
|
|
|
</div>
|
2026-07-26 16:14:32 +07:00
|
|
|
<MobileNav />
|
|
|
|
|
</div>
|
|
|
|
|
<Chatbot />
|
2026-07-26 15:34:08 +07:00
|
|
|
</WsProvider>
|
|
|
|
|
);
|
|
|
|
|
}
|