Files
gridpilot.gg/apps/website/lib/view-models/LeagueCardViewModel.ts
2025-12-19 23:18:53 +01:00

24 lines
576 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.
*/
export class LeagueCardViewModel {
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';
}
}