Files
gridpilot.gg/apps/website/lib/view-models/TeamCardViewModel.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

32 lines
761 B
TypeScript

import type { TeamListItemDTO } from '@/lib/types/generated/TeamListItemDTO';
interface TeamCardDTO {
id: string;
name: string;
tag: string;
description: string;
logoUrl?: string;
}
/**
* Team card view model
* UI representation of a team on the landing page.
*/
import { ViewModel } from "../contracts/view-models/ViewModel";
export class TeamCardViewModel extends ViewModel {
readonly id: string;
readonly name: string;
readonly tag: string;
readonly description: string;
readonly logoUrl?: string;
constructor(dto: TeamCardDTO | TeamListItemDTO) {
this.id = dto.id;
this.name = dto.name;
this.tag = dto.tag;
this.description = dto.description;
this.logoUrl = 'logoUrl' in dto ? dto.logoUrl : undefined;
}
}