import { ReactNode } from "react"; import Link from "next/link"; import { Shield, LogOut, Settings, Users, LayoutDashboardIcon, BarChart3 } from "lucide-react"; import { Button } from "@/components/ui/button"; import { getLoggedInUser } from "@/lib/actions/auth"; import { redirect } from 'next/navigation'; interface AdminLayoutProps { children: ReactNode; } export default async function AdminLayout({ children }: AdminLayoutProps) { const user = await getLoggedInUser(); if (!user || user.role !== 'admin') { redirect('/admin/login'); } return (