view data fixes
This commit is contained in:
@@ -4,16 +4,21 @@
|
||||
* Represents the total number of leagues in a UI-ready format.
|
||||
*/
|
||||
import { ViewModel } from "../contracts/view-models/ViewModel";
|
||||
import type { LeagueStatsViewData } from "../view-data/LeagueStatsViewData";
|
||||
|
||||
export class LeagueStatsViewModel extends ViewModel {
|
||||
totalLeagues: number;
|
||||
private readonly data: LeagueStatsViewData;
|
||||
|
||||
constructor(dto: { totalLeagues: number }) {
|
||||
this.totalLeagues = dto.totalLeagues;
|
||||
constructor(data: LeagueStatsViewData) {
|
||||
super();
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
get totalLeagues(): number { return this.data.totalLeagues; }
|
||||
|
||||
/** UI-specific: Formatted total leagues display */
|
||||
get formattedTotalLeagues(): string {
|
||||
// Client-only formatting
|
||||
return this.totalLeagues.toLocaleString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user