import { Sidebar } from "@/components/sidebar";
import { auth } from "@/auth";
import { redirect } from "next/navigation";
import {
    LayoutDashboard,
    Receipt,
    Clock,
    FileText,
} from "lucide-react";

export default async function WorkerLayout({
    children,
}: {
    children: React.ReactNode;
}) {
    const session = await auth();

    if (!session?.user) {
        redirect("/login");
    }

    return (
        <div className="flex h-screen bg-neutral-50 dark:bg-neutral-950">
            <Sidebar
                portal="worker"
                user={{
                    name: session.user.name,
                    email: session.user.email,
                    role: "Worker Account"
                }}
            />
            <main className="flex-1 overflow-y-auto p-8 relative">
                <div className="max-w-7xl mx-auto space-y-8">
                    {children}
                </div>

                {/* Subtle Background Elements for Modern Look */}
                <div className="fixed top-[-10%] left-[-10%] w-[40%] h-[40%] bg-indigo-500/5 blur-[120px] -z-10 rounded-full" />
                <div className="fixed bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-violet-500/5 blur-[120px] -z-10 rounded-full" />
            </main>
        </div>
    );
}
