24 lines
678 B
TypeScript
24 lines
678 B
TypeScript
/**
|
|
* View Model for League Statistics
|
|
*
|
|
* 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 {
|
|
private readonly data: LeagueStatsViewData;
|
|
|
|
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();
|
|
}
|
|
} |