Files
gridpilot.gg/apps/website/lib/view-models/LeagueScheduleViewModel.ts
2026-01-24 01:25:46 +01:00

21 lines
558 B
TypeScript

import { ViewModel } from "../contracts/view-models/ViewModel";
import type { LeagueScheduleViewData } from "../view-data/LeagueScheduleViewData";
import type { LeagueScheduleRaceViewModel } from "./LeagueScheduleRaceViewModel";
export class LeagueScheduleViewModel extends ViewModel {
readonly races: LeagueScheduleRaceViewModel[];
constructor(data: LeagueScheduleViewData) {
super();
this.races = data.races;
}
get raceCount(): number {
return this.races.length;
}
get hasRaces(): boolean {
return this.raceCount > 0;
}
}