mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-02-23 02:41:59 +00:00
61 lines
1.7 KiB
TypeScript
61 lines
1.7 KiB
TypeScript
|
import { ModeToggle } from "@/components/theme-toggle";
|
||
|
import { AppSidebar } from "@/components/ui/app-sidebar";
|
||
|
import {
|
||
|
Breadcrumb,
|
||
|
BreadcrumbItem,
|
||
|
BreadcrumbLink,
|
||
|
BreadcrumbList,
|
||
|
BreadcrumbPage,
|
||
|
BreadcrumbSeparator,
|
||
|
} from "@/components/ui/breadcrumb";
|
||
|
import { Separator } from "@/components/ui/separator";
|
||
|
import {
|
||
|
SidebarInset,
|
||
|
SidebarProvider,
|
||
|
SidebarTrigger,
|
||
|
} from "@/components/ui/sidebar";
|
||
|
import { auth } from "@/lib/auth";
|
||
|
import { headers } from "next/headers";
|
||
|
import { AccountPopover } from "./account-popver";
|
||
|
|
||
|
export async function ApplicationLayout({ children }: { children: React.ReactNode }) {
|
||
|
const session = await auth.api.getSession({
|
||
|
headers: await headers(), // you need to pass the headers object.
|
||
|
});
|
||
|
return (
|
||
|
<SidebarProvider>
|
||
|
<AppSidebar />
|
||
|
<SidebarInset>
|
||
|
<header className="flex justify-between sticky top-0 bg-background h-16 shrink-0 items-center gap-2 border-b px-4">
|
||
|
<div className="flex items-center gap-2">
|
||
|
<SidebarTrigger className="-ml-1" />
|
||
|
<Separator orientation="vertical" className="mr-2 h-4" />
|
||
|
<Breadcrumb>
|
||
|
<BreadcrumbList>
|
||
|
<BreadcrumbItem className="hidden md:block">
|
||
|
<BreadcrumbLink href="#">
|
||
|
MENU
|
||
|
</BreadcrumbLink>
|
||
|
</BreadcrumbItem>
|
||
|
<BreadcrumbSeparator className="hidden md:block" />
|
||
|
<BreadcrumbItem>
|
||
|
<BreadcrumbPage>Sar Link Portal v1.0.0</BreadcrumbPage>
|
||
|
</BreadcrumbItem>
|
||
|
</BreadcrumbList>
|
||
|
</Breadcrumb>
|
||
|
</div>
|
||
|
|
||
|
<div className="flex items-center gap-2">
|
||
|
<ModeToggle />
|
||
|
<AccountPopover user={session?.user} />
|
||
|
</div>
|
||
|
</header>
|
||
|
<div className="px-8 py-6">
|
||
|
|
||
|
{children}
|
||
|
</div>
|
||
|
</SidebarInset>
|
||
|
</SidebarProvider>
|
||
|
);
|
||
|
}
|