import type { ReactNode } from "react"; import { ArrowLeft, FolderKanban, Globe2, ImageIcon, LayoutDashboard, LogOut, PlusSquare, ShieldAlert, SwatchBook, Tags, } from "lucide-react"; import Link from "next/link"; import { DashboardLayout } from "@/components/dashboard/dashboard-layout"; import { MotionFade } from "@/components/motion-fade"; import { ThemeToggle } from "@/components/theme-toggle"; import { Button } from "@/components/ui/button"; import { getSiteSettingsMediaBindings } from "@/lib/app-config"; import { getLocalizedPath } from "@/lib/locale"; import { getRootNavigation } from "@/lib/root-navigation"; type RootDashboardCopy = { title: string; subtitle: string; overview: string; maintenance: string; uiKit: string; portfolio: string; media: string; siteSettings: string; logout: string; backToSite: string; }; type RootDashboardShellProps = { copy: RootDashboardCopy; active: "overview" | "maintenance" | "ui-kit" | "portfolio" | "media" | "site-settings"; portfolioChild?: "overview" | "projects" | "new-project" | "categories"; logoutAction: () => Promise; headerTitle: string; headerDescription: string; headerActions?: ReactNode; sidebarTopContent?: ReactNode; toolbar?: ReactNode; children: ReactNode; }; export async function RootDashboardShell({ copy, active, portfolioChild, logoutAction, headerTitle, headerDescription, headerActions, sidebarTopContent, toolbar, children, }: RootDashboardShellProps) { const mediaBindings = await getSiteSettingsMediaBindings(); const sidebarItems = getRootNavigation(copy, active, portfolioChild).filter( (item) => item.href !== "/root/maintenance" && item.href !== "/root/ui-kit", ); const headerIcon = active === "overview" ? LayoutDashboard : active === "maintenance" ? ShieldAlert : active === "ui-kit" ? SwatchBook : active === "site-settings" ? Globe2 : active === "media" ? ImageIcon : portfolioChild === "categories" ? Tags : portfolioChild === "new-project" ? PlusSquare : FolderKanban; const sharedActions = ( <> ); return ( {sidebarTopContent} } sidebarFooter={ <>
} headerActions={
{headerActions} {sharedActions}
} >
{toolbar ? {toolbar} : null} {children}
); }