37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { ViewModel } from "../contracts/view-models/ViewModel";
|
|
import type { DriverRegistrationStatusViewData } from "../view-data/DriverRegistrationStatusViewData";
|
|
import { DriverRegistrationStatusDisplay } from "../display-objects/DriverRegistrationStatusDisplay";
|
|
|
|
export class DriverRegistrationStatusViewModel extends ViewModel {
|
|
constructor(private readonly viewData: DriverRegistrationStatusViewData) {
|
|
super();
|
|
}
|
|
|
|
get isRegistered(): boolean {
|
|
return this.viewData.isRegistered;
|
|
}
|
|
|
|
get raceId(): string {
|
|
return this.viewData.raceId;
|
|
}
|
|
|
|
get driverId(): string {
|
|
return this.viewData.driverId;
|
|
}
|
|
|
|
get canRegister(): boolean {
|
|
return this.viewData.canRegister;
|
|
}
|
|
|
|
get statusMessage(): string {
|
|
return DriverRegistrationStatusDisplay.statusMessage(this.isRegistered);
|
|
}
|
|
|
|
get statusBadgeVariant(): string {
|
|
return DriverRegistrationStatusDisplay.statusBadgeVariant(this.isRegistered);
|
|
}
|
|
|
|
get registrationButtonText(): string {
|
|
return DriverRegistrationStatusDisplay.registrationButtonText(this.isRegistered);
|
|
}
|
|
} |