2022-11-11 22:17:44 -05:00
|
|
|
import { getCurrentUser } from "@lib/server/session"
|
|
|
|
import { redirect } from "next/navigation"
|
|
|
|
|
2022-11-09 22:46:12 -05:00
|
|
|
export default function NewLayout({ children }: { children: React.ReactNode }) {
|
2022-11-11 22:17:44 -05:00
|
|
|
const user = getCurrentUser()
|
|
|
|
if (!user) {
|
|
|
|
return redirect("/new")
|
|
|
|
}
|
|
|
|
|
2022-11-10 02:11:36 -05:00
|
|
|
return <>{children}</>
|
2022-11-09 22:46:12 -05:00
|
|
|
}
|