@@ -88,56 +88,57 @@ export default function GamificationAnalytics() {
8888 < p className = "text-slate-600 mt-1" > Advanced insights into engagement and rewards</ p >
8989 </ div >
9090
91- { /* Key Metrics Overview */ }
92- < div className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4" >
93- < Card >
94- < CardContent className = "pt-6" >
95- < div className = "flex items-center justify-between" >
96- < div >
97- < p className = "text-sm text-slate-600" > Total Users</ p >
98- < p className = "text-3xl font-bold text-slate-900" > { totalUsers } </ p >
99- </ div >
100- < Users className = "h-8 w-8 text-blue-500" />
101- </ div >
91+ { /* Empty State */ }
92+ { ! hasData ? (
93+ < Card className = "bg-slate-900 border-slate-800" >
94+ < CardContent className = "py-12 text-center" >
95+ < AlertCircle className = "h-12 w-12 text-slate-400 mx-auto mb-4" />
96+ < p className = "text-slate-300 text-lg font-medium" > No gamification activity yet</ p >
97+ < p className = "text-slate-400 mt-1" > Points and badges will appear here as users engage.</ p >
10298 </ CardContent >
10399 </ Card >
104-
105- < Card >
106- < CardContent className = "pt-6" >
107- < div className = "flex items-center justify-between" >
108- < div >
109- < p className = "text-sm text-slate-600" > Total Points Awarded</ p >
110- < p className = "text-3xl font-bold text-slate-900" > { totalPoints . toLocaleString ( ) } </ p >
111- </ div >
112- < Trophy className = "h-8 w-8 text-int-orange" />
113- </ div >
114- </ CardContent >
115- </ Card >
116-
117- < Card >
118- < CardContent className = "pt-6" >
119- < div className = "flex items-center justify-between" >
120- < div >
121- < p className = "text-sm text-slate-600" > Avg Points/User</ p >
122- < p className = "text-3xl font-bold text-slate-900" > { avgPointsPerUser } </ p >
123- </ div >
124- < TrendingUp className = "h-8 w-8 text-green-500" />
125- </ div >
126- </ CardContent >
127- </ Card >
128-
129- < Card >
130- < CardContent className = "pt-6" >
131- < div className = "flex items-center justify-between" >
132- < div >
133- < p className = "text-sm text-slate-600" > Redemption Rate</ p >
134- < p className = "text-3xl font-bold text-slate-900" > { redemptionRate } %</ p >
135- </ div >
136- < Gift className = "h-8 w-8 text-purple-500" />
137- </ div >
138- </ CardContent >
139- </ Card >
140- </ div >
100+ ) : (
101+ < >
102+ { /* Key Metrics Overview */ }
103+ < div className = "grid grid-cols-1 md:grid-cols-3 gap-4" >
104+ < Card className = "bg-slate-900 border-slate-800" >
105+ < CardContent className = "pt-6" >
106+ < div className = "flex items-center justify-between" >
107+ < div >
108+ < p className = "text-sm text-slate-400" > Total Points Distributed</ p >
109+ < p className = "text-3xl font-bold text-white" > { totalPointsDistributed . toLocaleString ( ) } </ p >
110+ </ div >
111+ < Trophy className = "h-8 w-8 text-int-orange" />
112+ </ div >
113+ </ CardContent >
114+ </ Card >
115+
116+ < Card className = "bg-slate-900 border-slate-800" >
117+ < CardContent className = "pt-6" >
118+ < div className = "flex items-center justify-between" >
119+ < div >
120+ < p className = "text-sm text-slate-400" > Total Badges Awarded</ p >
121+ < p className = "text-3xl font-bold text-white" > { totalBadgesAwarded } </ p >
122+ </ div >
123+ < Gift className = "h-8 w-8 text-purple-400" />
124+ </ div >
125+ </ CardContent >
126+ </ Card >
127+
128+ < Card className = "bg-slate-900 border-slate-800" >
129+ < CardContent className = "pt-6" >
130+ < div className = "flex items-center justify-between" >
131+ < div >
132+ < p className = "text-sm text-slate-400" > Challenge Joins</ p >
133+ < p className = "text-3xl font-bold text-white" > { totalChallengeJoins } </ p >
134+ </ div >
135+ < TrendingUp className = "h-8 w-8 text-green-400" />
136+ </ div >
137+ </ CardContent >
138+ </ Card >
139+ </ div >
140+ </ >
141+ ) }
141142
142143 { /* Analytics Tabs */ }
143144 < Tabs defaultValue = "tiers" className = "space-y-4" >
0 commit comments