18 lines
677 B
TypeScript
18 lines
677 B
TypeScript
import { ViewModel } from "../contracts/view-models/ViewModel";
|
|
import type { RaceDetailEntryViewData } from "../view-data/RaceDetailEntryViewData";
|
|
|
|
export class RaceDetailEntryViewModel extends ViewModel {
|
|
private readonly data: RaceDetailEntryViewData;
|
|
|
|
constructor(data: RaceDetailEntryViewData) {
|
|
super();
|
|
this.data = data;
|
|
}
|
|
|
|
get id(): string { return this.data.id; }
|
|
get name(): string { return this.data.name; }
|
|
get country(): string { return this.data.country; }
|
|
get avatarUrl(): string { return this.data.avatarUrl; }
|
|
get isCurrentUser(): boolean { return this.data.isCurrentUser; }
|
|
get rating(): number | null { return this.data.rating; }
|
|
} |