Improve admin save UX and portfolio navigation
CI / quality (push) Waiting to run

This commit is contained in:
MOH
2026-03-07 19:20:58 +01:00
parent 3d1976a7a5
commit ee21e8b823
19 changed files with 652 additions and 424 deletions
+7 -3
View File
@@ -1,6 +1,6 @@
import type { ReactNode } from "react";
import Link from "next/link";
import type { LucideIcon } from "lucide-react";
import { ChevronDown, ChevronRight, type LucideIcon } from "lucide-react";
import { Separator } from "@/components/ui/separator";
import { cn } from "@/lib/utils";
@@ -10,6 +10,7 @@ type DashboardSidebarItem = {
href: string;
icon: LucideIcon;
active?: boolean;
expanded?: boolean;
children?: DashboardSidebarItem[];
};
@@ -23,6 +24,8 @@ type DashboardSidebarProps = {
export function DashboardSidebar({ items, iconSrc, top, footer }: DashboardSidebarProps) {
function renderItem(item: DashboardSidebarItem, nested = false) {
const Icon = item.icon;
const hasChildren = Boolean(item.children?.length);
const ChevronIcon = item.expanded ? ChevronDown : ChevronRight;
return (
<div key={item.href} className="space-y-1">
@@ -37,9 +40,10 @@ export function DashboardSidebar({ items, iconSrc, top, footer }: DashboardSideb
)}
>
<Icon className="h-4 w-4" />
<span>{item.label}</span>
<span className="flex-1">{item.label}</span>
{hasChildren ? <ChevronIcon className="h-4 w-4 opacity-70" /> : null}
</Link>
{item.children?.length ? item.children.map((child) => renderItem(child, true)) : null}
{item.expanded && item.children?.length ? item.children.map((child) => renderItem(child, true)) : null}
</div>
);
}