website refactor
This commit is contained in:
17
apps/website/lib/view-data/AdminDashboardViewData.ts
Normal file
17
apps/website/lib/view-data/AdminDashboardViewData.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* AdminDashboardViewData
|
||||
*
|
||||
* ViewData for AdminDashboardTemplate.
|
||||
* Template-ready data structure with only primitives.
|
||||
*/
|
||||
export interface AdminDashboardViewData {
|
||||
stats: {
|
||||
totalUsers: number;
|
||||
activeUsers: number;
|
||||
suspendedUsers: number;
|
||||
deletedUsers: number;
|
||||
systemAdmins: number;
|
||||
recentLogins: number;
|
||||
newUsersToday: number;
|
||||
};
|
||||
}
|
||||
@@ -45,6 +45,24 @@ export interface DriverSummaryData {
|
||||
profileUrl: string;
|
||||
}
|
||||
|
||||
export interface SponsorMetric {
|
||||
icon: any; // React component (lucide-react icon)
|
||||
label: string;
|
||||
value: string | number;
|
||||
color?: string;
|
||||
trend?: {
|
||||
value: number;
|
||||
isPositive: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface SponsorshipSlot {
|
||||
tier: 'main' | 'secondary';
|
||||
available: boolean;
|
||||
price: number;
|
||||
benefits: string[];
|
||||
}
|
||||
|
||||
export interface LeagueDetailViewData {
|
||||
// Basic info
|
||||
leagueId: string;
|
||||
@@ -79,5 +97,7 @@ export interface LeagueDetailViewData {
|
||||
mainSponsorPrice: number;
|
||||
secondaryPrice: number;
|
||||
totalImpressions: number;
|
||||
metrics: SponsorMetric[];
|
||||
slots: SponsorshipSlot[];
|
||||
} | null;
|
||||
}
|
||||
@@ -6,10 +6,13 @@
|
||||
export interface StandingEntryData {
|
||||
driverId: string;
|
||||
position: number;
|
||||
points: number;
|
||||
wins: number;
|
||||
podiums: number;
|
||||
races: number;
|
||||
totalPoints: number;
|
||||
racesFinished: number;
|
||||
racesStarted: number;
|
||||
avgFinish: number | null;
|
||||
penaltyPoints: number;
|
||||
bonusPoints: number;
|
||||
teamName?: string;
|
||||
}
|
||||
|
||||
export interface DriverData {
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
* Contains only raw serializable data, no methods or computed properties
|
||||
*/
|
||||
|
||||
export interface SponsorMetric {
|
||||
icon: any; // React component (lucide-react icon)
|
||||
label: string;
|
||||
value: string | number;
|
||||
color?: string;
|
||||
trend?: {
|
||||
value: number;
|
||||
isPositive: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export interface TeamDetailData {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -32,9 +43,17 @@ export interface TeamMemberData {
|
||||
avatarUrl: string;
|
||||
}
|
||||
|
||||
export interface TeamTab {
|
||||
id: 'overview' | 'roster' | 'standings' | 'admin';
|
||||
label: string;
|
||||
visible: boolean;
|
||||
}
|
||||
|
||||
export interface TeamDetailViewData {
|
||||
team: TeamDetailData;
|
||||
memberships: TeamMemberData[];
|
||||
currentDriverId: string;
|
||||
isAdmin: boolean;
|
||||
teamMetrics: SponsorMetric[];
|
||||
tabs: TeamTab[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user