Fix: Polish projects menu

This commit is contained in:
MangoPig
2026-06-20 07:56:47 +01:00
parent 12cbc68db6
commit 5a565f8165
6 changed files with 737 additions and 94 deletions

View File

@@ -194,6 +194,16 @@ const buildProjectItems = (payload: AppShellPayload | null): readonly ProjectIte
id: project.id,
name: project.name,
description: project.slug || "Persisted project workspace",
groupLabel: payload.departments.find((department) => department.id === project.departmentId)?.name || "Projects",
parentLabel:
payload.teams.find((team) => team.id === project.teamId)?.name ||
payload.departments.find((department) => department.id === project.departmentId)?.name ||
"Shared project",
meta: (() => {
const workspaceCount = payload.workspaces.filter((workspace) => workspace.projectId === project.id).length;
return workspaceCount > 0 ? `${workspaceCount} workspace${workspaceCount === 1 ? "" : "s"}` : undefined;
})(),
active: index === 0,
}));
};