shahrbin-citizen/app/User/layout.tsx

26 lines
861 B
TypeScript

import SideMenu from "@/components/Menu/SideMenu";
import UserHeader from "@/components/User/UserHeader";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
export default function RequestLayout({
children, // will be a page or nested layout
}: {
children: React.ReactNode;
}) {
const cookieStore = cookies();
const token = cookieStore.get("Shahrbin_Token");
if (!token) {
redirect("/");
}
return (
<section className="flex justify-end">
{/* Include shared UI here e.g. a header or sidebar */}
<SideMenu />
<UserHeader />
<div className=" w-[calc(100%-208px)] h-[calc(100%-100px)] flex flex-1 p-10 flex-col overflow-hidden overflow-y-auto fixed top-[60px] left-0 transition-all scrollbar-thin scrollbar-thumb-yellow scrollbar-track-white">{children}</div>
</section>
);
}