Files
gridpilot.gg/apps/website/lib/view-models/LeagueCardViewModel.ts
Marc Mintel d97f50ed72
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 6m4s
Contract Testing / contract-snapshot (pull_request) Has been skipped
view data fixes
2026-01-23 11:59:49 +01:00

26 lines
659 B
TypeScript

import type { LeagueSummaryDTO } from '@/lib/types/generated/LeagueSummaryDTO';
interface LeagueCardDTO {
id: string;
name: string;
description?: string;
}
/**
* League card view model
* UI representation of a league on the landing page.
*/
import { ViewModel } from "../contracts/view-models/ViewModel";
export class LeagueCardViewModel extends ViewModel {
readonly id: string;
readonly name: string;
readonly description: string;
constructor(dto: LeagueCardDTO | LeagueSummaryDTO & { description?: string }) {
this.id = dto.id;
this.name = dto.name;
this.description = dto.description ?? 'Competitive iRacing league';
}
}