feat: persist portal invitation locales

This commit is contained in:
poyrazavsever
2026-07-19 03:07:35 +03:00
parent c1c473469a
commit 0158f2f25a
10 changed files with 249 additions and 46 deletions
+19 -4
View File
@@ -7,6 +7,7 @@ import {
export type PortalSidebarNavItem = {
title: string;
titleKey?: string;
href?: string;
icon?: LucideIcon;
items?: PortalSidebarNavItem[];
@@ -14,22 +15,36 @@ export type PortalSidebarNavItem = {
export type PortalSidebarNavGroup = {
title: string;
titleKey?: string;
items: PortalSidebarNavItem[];
};
export const portalSidebarData: PortalSidebarNavGroup[] = [
{
title: "GENEL BAKIŞ",
titleKey: "navigation.groups.overview",
items: [
{ title: "Dashboard", href: "/portal", icon: Sparkles },
{ title: "Dashboard", titleKey: "navigation.items.dashboard", href: "/portal", icon: Sparkles },
],
},
{
title: "SÜREÇLER",
titleKey: "navigation.groups.processes",
items: [
{ title: "Projeleriniz", href: "/portal/projects", icon: FolderKanban },
{ title: "Yapılan Görevler", href: "/portal/tasks", icon: CheckSquare2 },
{ title: "Revizyon Talepleri", href: "/portal/revisions", icon: Sparkles },
{ title: "Projeleriniz", titleKey: "navigation.items.portalProjects", href: "/portal/projects", icon: FolderKanban },
{ title: "Yapılan Görevler", titleKey: "navigation.items.portalTasks", href: "/portal/tasks", icon: CheckSquare2 },
{ title: "Revizyon Talepleri", titleKey: "navigation.items.portalRevisions", href: "/portal/revisions", icon: Sparkles },
],
}
];
export function localizePortalSidebarData(t: (key: string) => string): PortalSidebarNavGroup[] {
return portalSidebarData.map((group) => ({
...group,
title: group.titleKey ? t(group.titleKey) : group.title,
items: group.items.map((item) => ({
...item,
title: item.titleKey ? t(item.titleKey) : item.title,
})),
}));
}