view models
This commit is contained in:
18
apps/website/lib/view-models/RaceStatsViewModel.ts
Normal file
18
apps/website/lib/view-models/RaceStatsViewModel.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { RaceStatsDTO } from '../types/generated';
|
||||
|
||||
/**
|
||||
* Race stats view model
|
||||
* Represents race statistics for display
|
||||
*/
|
||||
export class RaceStatsViewModel {
|
||||
totalRaces: number;
|
||||
|
||||
constructor(dto: RaceStatsDTO) {
|
||||
this.totalRaces = dto.totalRaces;
|
||||
}
|
||||
|
||||
/** UI-specific: Formatted total races */
|
||||
get formattedTotalRaces(): string {
|
||||
return this.totalRaces.toLocaleString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user