Implement portfolio admin management

This commit is contained in:
MOH
2026-03-07 16:06:20 +01:00
parent f983ce2203
commit ea64373853
35 changed files with 5126 additions and 178 deletions
+56 -2
View File
@@ -1,9 +1,20 @@
import { LayoutDashboard, ShieldAlert, SwatchBook, type LucideIcon } from "lucide-react";
import {
FolderKanban,
ImageIcon,
LayoutDashboard,
PlusSquare,
ShieldAlert,
SwatchBook,
Tags,
type LucideIcon,
} from "lucide-react";
type RootNavigationCopy = {
overview: string;
maintenance: string;
uiKit: string;
portfolio: string;
media: string;
};
export type RootNavItem = {
@@ -11,11 +22,13 @@ export type RootNavItem = {
href: string;
icon: LucideIcon;
active?: boolean;
children?: RootNavItem[];
};
export function getRootNavigation(
copy: RootNavigationCopy,
active: "overview" | "maintenance" | "ui-kit",
active: "overview" | "maintenance" | "ui-kit" | "portfolio" | "media",
portfolioChild?: "overview" | "projects" | "new-project" | "categories",
): RootNavItem[] {
return [
{
@@ -36,5 +49,46 @@ export function getRootNavigation(
icon: SwatchBook,
active: active === "ui-kit",
},
{
label: copy.media,
href: "/root/media",
icon: ImageIcon,
active: active === "media",
},
{
label: copy.portfolio,
href: "/root/portfolio",
icon: FolderKanban,
active: active === "portfolio",
children:
active === "portfolio"
? [
{
label: "Overview",
href: "/root/portfolio",
icon: LayoutDashboard,
active: portfolioChild === "overview",
},
{
label: "Add Project",
href: "/root/portfolio/projects/new",
icon: PlusSquare,
active: portfolioChild === "new-project",
},
{
label: "Add Category",
href: "/root/portfolio/categories",
icon: Tags,
active: portfolioChild === "categories",
},
{
label: "Projects",
href: "/root/portfolio/projects",
icon: FolderKanban,
active: portfolioChild === "projects",
},
].filter((item, index, array) => array.findIndex((entry) => entry.href === item.href) === index)
: undefined,
},
];
}