wip
This commit is contained in:
@@ -33,17 +33,20 @@ function hashString(input: string): number {
|
||||
|
||||
export function getDriverAvatar(driverId: string): string {
|
||||
const index = hashString(driverId) % DRIVER_AVATARS.length;
|
||||
return DRIVER_AVATARS[index];
|
||||
const avatar = DRIVER_AVATARS[index] ?? DRIVER_AVATARS[0];
|
||||
return avatar;
|
||||
}
|
||||
|
||||
export function getTeamLogo(teamId: string): string {
|
||||
const index = hashString(teamId) % TEAM_LOGOS.length;
|
||||
return TEAM_LOGOS[index];
|
||||
const logo = TEAM_LOGOS[index] ?? TEAM_LOGOS[0];
|
||||
return logo;
|
||||
}
|
||||
|
||||
export function getLeagueBanner(leagueId: string): string {
|
||||
const index = hashString(leagueId) % LEAGUE_BANNERS.length;
|
||||
return LEAGUE_BANNERS[index];
|
||||
const banner = LEAGUE_BANNERS[index] ?? LEAGUE_BANNERS[0];
|
||||
return banner;
|
||||
}
|
||||
|
||||
export interface LeagueCoverImage {
|
||||
|
||||
Reference in New Issue
Block a user