import { cookies } from "next/headers"
import {
    SidebarInset,
    SidebarProvider,
} from "@/components/ui/sidebar"
import { redirect } from "next/navigation"

export default async function Layout({ children }: { children: React.ReactNode }) {

    const isLoggedIn = (await cookies()).get('jwt')?.value

    if (isLoggedIn) {
        redirect('/')
    }

    return (
        <>{children}</>
    )
}