Files

29 lines
1.0 KiB
TypeScript
Raw Permalink Normal View History

2026-02-26 15:29:00 +01:00
import { ReactNode } from "react";
2026-02-25 13:00:52 +01:00
import { redirect } from "next/navigation";
2024-11-10 23:12:38 +01:00
2026-02-25 13:00:52 +01:00
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar";
2026-05-24 17:09:12 +02:00
import { AppSidebar } from "@/features/layout/app-sidebar";
import { Header } from "@/features/layout/header";
2026-02-25 13:00:52 +01:00
import { currentUser } from "@/lib/auth/current-user";
2026-05-24 17:09:12 +02:00
import { ThemeMetaUpdater } from "@/features/theme/theme-meta-updater";
import { ModeToggle } from "@/features/theme/mode-toggle";
import { UpdateNotification } from "@/features/updates/update-notification";
2026-02-25 13:00:52 +01:00
export default async function Layout({ children }: { children: ReactNode }) {
const user = await currentUser();
if (!user) redirect("/login");
2024-11-10 23:12:38 +01:00
2026-02-25 13:00:52 +01:00
return (
<SidebarProvider>
<div className="flex flex-col lg:flex-row w-full">
<ThemeMetaUpdater />
2026-05-24 17:09:12 +02:00
<AppSidebar updateNotification={<UpdateNotification />} />
2026-02-25 13:00:52 +01:00
<SidebarInset>
2026-05-24 17:09:12 +02:00
<Header actions={<ModeToggle />} />
2026-02-26 15:29:00 +01:00
<main className="h-full">{children}</main>
2026-02-25 13:00:52 +01:00
</SidebarInset>
</div>
</SidebarProvider>
);
2025-05-16 15:54:17 +02:00
}