refactor(app): extract project icon placeholder label logic

This commit is contained in:
Mohamed Boudra
2026-03-06 23:43:02 +07:00
parent 8dd94757d7
commit 604b41db9b
3 changed files with 43 additions and 1 deletions
@@ -7,3 +7,15 @@ export function projectDisplayNameFromProjectId(projectId: string): string {
const segments = projectId.split(/[\\/]/).filter(Boolean);
return segments[segments.length - 1] || projectId;
}
export function projectIconPlaceholderLabelFromDisplayName(
displayName: string
): string {
const trimmedDisplayName = displayName.trim();
if (!trimmedDisplayName) {
return "";
}
const segments = trimmedDisplayName.split("/").filter(Boolean);
return segments[segments.length - 1] || trimmedDisplayName;
}