Update root sidebar header and actions

This commit is contained in:
MOH
2026-03-07 18:37:40 +01:00
parent 4f983f20b5
commit 02891ec45b
3 changed files with 29 additions and 33 deletions
+18 -14
View File
@@ -2,9 +2,9 @@ import type { ReactNode } from "react";
import {
ArrowLeft,
FolderKanban,
Globe2,
ImageIcon,
LayoutDashboard,
LogOut,
PlusSquare,
ShieldAlert,
SwatchBook,
@@ -27,13 +27,14 @@ type RootDashboardCopy = {
uiKit: string;
portfolio: string;
media: string;
siteSettings: string;
logout: string;
backToSite: string;
};
type RootDashboardShellProps = {
copy: RootDashboardCopy;
active: "overview" | "maintenance" | "ui-kit" | "portfolio" | "media";
active: "overview" | "maintenance" | "ui-kit" | "portfolio" | "media" | "site-settings";
portfolioChild?: "overview" | "projects" | "new-project" | "categories";
logoutAction: () => Promise<void>;
headerTitle: string;
@@ -64,6 +65,8 @@ export function RootDashboardShell({
? ShieldAlert
: active === "ui-kit"
? SwatchBook
: active === "site-settings"
? Globe2
: active === "media"
? ImageIcon
: portfolioChild === "categories"
@@ -74,18 +77,6 @@ export function RootDashboardShell({
const sharedActions = (
<>
<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>
</>
);
@@ -95,6 +86,14 @@ export function RootDashboardShell({
description={headerDescription}
icon={headerIcon}
items={sidebarItems}
sidebarTop={
<Button asChild variant="outline" className="w-full justify-between">
<Link href={getLocalizedPath("de")} target="_blank" rel="noreferrer">
{copy.backToSite}
<ArrowLeft className="h-4 w-4" />
</Link>
</Button>
}
sidebarFooter={
<>
<Button
@@ -117,6 +116,11 @@ export function RootDashboardShell({
<SwatchBook className="h-4 w-4" />
</Link>
</Button>
<form action={logoutAction}>
<Button type="submit" variant="ghost" className="w-full justify-between text-destructive hover:bg-destructive/10 hover:text-destructive">
{copy.logout}
</Button>
</form>
</>
}
headerActions={