Fix shared root sidebar layout
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-07 17:39:06 +01:00
parent 8606f6e315
commit 4f983f20b5
+10 -52
View File
@@ -2,13 +2,9 @@ import {
ExternalLink,
FolderKanban,
ImageIcon,
LayoutDashboard,
LockKeyhole,
LogOut,
ShieldAlert,
Shapes,
SwatchBook,
ArrowLeft,
} from "lucide-react";
import Link from "next/link";
import { redirect } from "next/navigation";
@@ -16,8 +12,7 @@ import { redirect } from "next/navigation";
import { Container } from "@/components/layout/container";
import { MotionFade } from "@/components/motion-fade";
import { DashboardCard } from "@/components/dashboard/dashboard-card";
import { DashboardLayout } from "@/components/dashboard/dashboard-layout";
import { ThemeToggle } from "@/components/theme-toggle";
import { RootDashboardShell } from "@/components/root/root-dashboard-shell";
import { Badge, type BadgeProps } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
@@ -43,13 +38,11 @@ import {
setAdminSessionCookie,
} from "@/lib/admin-auth";
import { getMaintenanceMode } from "@/lib/app-config";
import { getLocalizedPath } from "@/lib/locale";
import { getAdminMediaAssets } from "@/lib/media";
import {
getAdminPortfolioCategories,
getAdminPortfolioProjects,
} from "@/lib/portfolio";
import { getRootNavigation } from "@/lib/root-navigation";
type RootPageProps = {
searchParams?: {
@@ -220,7 +213,6 @@ export default async function RootPage({ searchParams }: RootPageProps) {
getAdminMediaAssets(),
]);
const publishedProjects = projects.filter((project) => project.isPublished).length;
const rootNavigation = getRootNavigation(copy, "overview");
const authHealthy = authConfigured && basicConfigured;
const sectionRows: Array<{
label: string;
@@ -265,52 +257,18 @@ export default async function RootPage({ searchParams }: RootPageProps) {
];
return (
<DashboardLayout
title={copy.title}
description={copy.subtitle}
icon={LayoutDashboard}
items={rootNavigation}
sidebarFooter={
<>
<Button
asChild
variant={maintenanceEnabled ? "default" : "outline"}
className="w-full justify-between"
>
<Link href="/root/maintenance">
{copy.maintenance}
<ShieldAlert className="h-4 w-4" />
</Link>
</Button>
<Button asChild variant="outline" className="w-full justify-between">
<Link href="/root/ui-kit">
{copy.uiKit}
<SwatchBook className="h-4 w-4" />
</Link>
</Button>
</>
}
<RootDashboardShell
copy={copy}
active="overview"
logoutAction={logoutAction}
headerTitle={copy.title}
headerDescription={copy.subtitle}
headerActions={
<div className="flex flex-wrap items-center justify-end gap-2">
{maintenanceEnabled ? (
maintenanceEnabled ? (
<Button asChild variant="destructive" className="hidden sm:inline-flex">
<Link href="/root/maintenance">{copy.maintenanceVisitorsClosed}</Link>
</Button>
) : null}
<ThemeToggle ariaLabel="Theme wechseln" />
<Button asChild variant="outline" size="sm">
<Link href={getLocalizedPath("de")}>
<ArrowLeft className="h-4 w-4" />
{copy.backToSite}
</Link>
</Button>
<form action={logoutAction}>
<Button type="submit" variant="ghost" size="sm" className="text-destructive hover:bg-destructive/10 hover:text-destructive">
<LogOut className="h-4 w-4" />
{copy.logout}
</Button>
</form>
</div>
) : null
}
>
<div className="space-y-6">
@@ -433,6 +391,6 @@ export default async function RootPage({ searchParams }: RootPageProps) {
</div>
</section>
</div>
</DashboardLayout>
</RootDashboardShell>
);
}