"use client";

import { useEffect } from "react";
import { useRouter } from "next/navigation";
import Sidebar from "@/components/Sidebar";

export default function AuthLayout({ children }: { children: React.ReactNode }) {
    const router = useRouter();

    useEffect(() => {
        if (sessionStorage.getItem("wyview_auth") !== "true") {
            router.push("/");
        }
    }, [router]);

    return (
        <div className="flex min-h-screen">
            <Sidebar />
            <main className="ml-56 flex-1 p-8">
                {children}
            </main>
        </div>
    );
}