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:
@@ -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`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user