mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
26 lines
733 B
TypeScript
26 lines
733 B
TypeScript
import React from "react";
|
|
import {redirect} from "next/navigation";
|
|
|
|
import {SidebarInset, SidebarProvider} from "@/components/ui/sidebar"
|
|
import {AppSidebar} from "@/components/wrappers/Dashboard/SideBar/app-sidebar";
|
|
import {currentUser} from "@/auth/current-user";
|
|
import {Header} from "@/features/layout/Header";
|
|
|
|
|
|
export default async function Layout({children}: { children: React.ReactNode }) {
|
|
|
|
const user = await currentUser()
|
|
if (!user) redirect('/login')
|
|
|
|
return (
|
|
<SidebarProvider>
|
|
<AppSidebar/>
|
|
<SidebarInset>
|
|
<Header/>
|
|
<main>
|
|
{children}
|
|
</main>
|
|
</SidebarInset>
|
|
</SidebarProvider>
|
|
)
|
|
} |