Refactor avatar URL generation into reusable method

Centralized avatar URL generation with `getAvatarUrl()` method to reduce redundancy and improve code maintainability. Updated relevant components to utilize the new method for cleaner and more consistent implementation.
This commit is contained in:
2025-04-12 17:20:47 +02:00
parent 6a70428c75
commit a70159e88d
4 changed files with 35 additions and 25 deletions
@@ -89,4 +89,9 @@ export class HistoryComponent implements OnInit, OnChanges {
hour12: false
});
}
public getAvatarUrl(entry: PunishmentHistoryInner): string {
let uuid = entry.uuid.replace('-', '');
return `https://crafatar.com/avatars/${uuid}?size=25&overlay`;
}
}