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('is_logged_in')?.value === 'true'

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

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