refactor(app): extract project icon placeholder label logic
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user