Files
gridpilot.gg/apps/website/lib/view-models/RaceDetailEntryViewModel.ts
2026-01-12 01:01:49 +01:00

19 lines
539 B
TypeScript

import { RaceDetailEntryDTO } from '@/lib/types/generated/RaceDetailEntryDTO';
export class RaceDetailEntryViewModel {
id: string;
name: string;
country: string;
avatarUrl: string;
isCurrentUser: boolean;
rating: number | null;
constructor(dto: RaceDetailEntryDTO, currentDriverId: string, rating?: number) {
this.id = dto.id;
this.name = dto.name;
this.country = dto.country;
this.avatarUrl = dto.avatarUrl || '';
this.isCurrentUser = dto.id === currentDriverId;
this.rating = rating ?? null;
}
}