1+ import { Button } from "@/components/ui/button" ;
12import { Card , CardContent } from "@/components/ui/card" ;
2- import { Server , Cloud , Users , Activity } from "lucide-react" ;
3+ import { Activity , Cloud , Server , Users } from "lucide-react" ;
4+ import { useNavigate } from "react-router" ;
35
46interface DashboardProps {
7+ isAuthenticated : boolean ;
58 personalStats : {
69 total : number ;
710 active : number ;
@@ -12,68 +15,112 @@ interface DashboardProps {
1215 } ;
1316}
1417
15- export const Dashboard = ( { personalStats, teamStats } : DashboardProps ) => {
18+ export const Dashboard = ( {
19+ isAuthenticated,
20+ personalStats,
21+ teamStats,
22+ } : DashboardProps ) => {
23+ const navigate = useNavigate ( ) ;
24+
1625 return (
17- < div className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6" >
18- { /* Personal Total Servers */ }
19- < Card className = "border-blue-200 bg-blue-50/50" >
20- < CardContent className = "p-4" >
21- < div className = "flex items-center justify-between" >
22- < div >
23- < p className = "text-sm font-medium text-blue-600" > Personal Total</ p >
24- < p className = "text-2xl font-bold text-blue-900" > { personalStats . total } </ p >
25- </ div >
26- < div className = "h-8 w-8 bg-blue-100 rounded-full flex items-center justify-center" >
27- < Server className = "h-4 w-4 text-blue-600" />
26+ < >
27+ < div className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-6" >
28+ { /* Personal Total Servers */ }
29+ < Card className = "border-blue-200 bg-blue-50/50" >
30+ < CardContent className = "p-4" >
31+ < div className = "flex items-center justify-between" >
32+ < div >
33+ < p className = "text-sm font-medium text-blue-600" >
34+ Personal Total
35+ </ p >
36+ < p className = "text-2xl font-bold text-blue-900" >
37+ { isAuthenticated ? personalStats . total : "--" }
38+ </ p >
39+ </ div >
40+ < div className = "h-8 w-8 bg-blue-100 rounded-full flex items-center justify-center" >
41+ < Server className = "h-4 w-4 text-blue-600" />
42+ </ div >
2843 </ div >
29- </ div >
30- </ CardContent >
31- </ Card >
44+ </ CardContent >
45+ </ Card >
3246
33- { /* Personal Active Servers */ }
34- < Card className = "border-green-200 bg-green-50/50" >
35- < CardContent className = "p-4" >
36- < div className = "flex items-center justify-between" >
37- < div >
38- < p className = "text-sm font-medium text-green-600" > Personal Active</ p >
39- < p className = "text-2xl font-bold text-green-900" > { personalStats . active } </ p >
40- </ div >
41- < div className = "h-8 w-8 bg-green-100 rounded-full flex items-center justify-center" >
42- < Activity className = "h-4 w-4 text-green-600" />
47+ { /* Personal Active Servers */ }
48+ < Card className = "border-green-200 bg-green-50/50" >
49+ < CardContent className = "p-4" >
50+ < div className = "flex items-center justify-between" >
51+ < div >
52+ < p className = "text-sm font-medium text-green-600" >
53+ Personal Active
54+ </ p >
55+ < p className = "text-2xl font-bold text-green-900" >
56+ { isAuthenticated ? personalStats . active : "--" }
57+ </ p >
58+ </ div >
59+ < div className = "h-8 w-8 bg-green-100 rounded-full flex items-center justify-center" >
60+ < Activity className = "h-4 w-4 text-green-600" />
61+ </ div >
4362 </ div >
44- </ div >
45- </ CardContent >
46- </ Card >
63+ </ CardContent >
64+ </ Card >
4765
48- { /* Personal Disabled Servers */ }
49- < Card className = "border-orange-200 bg-orange-50/50" >
50- < CardContent className = "p-4" >
51- < div className = "flex items-center justify-between" >
52- < div >
53- < p className = "text-sm font-medium text-orange-600" > Personal Disabled</ p >
54- < p className = "text-2xl font-bold text-orange-900" > { personalStats . disabled } </ p >
66+ { /* Personal Disabled Servers */ }
67+ < Card className = "border-orange-200 bg-orange-50/50" >
68+ < CardContent className = "p-4" >
69+ < div className = "flex items-center justify-between" >
70+ < div >
71+ < p className = "text-sm font-medium text-orange-600" >
72+ Personal Disabled
73+ </ p >
74+ < p className = "text-2xl font-bold text-orange-900" >
75+ { isAuthenticated ? personalStats . disabled : "--" }
76+ </ p >
77+ </ div >
78+ < div className = "h-8 w-8 bg-orange-100 rounded-full flex items-center justify-center" >
79+ < Cloud className = "h-4 w-4 text-orange-600" />
80+ </ div >
5581 </ div >
56- < div className = "h-8 w-8 bg-orange-100 rounded-full flex items-center justify-center" >
57- < Cloud className = "h-4 w-4 text-orange-600" />
58- </ div >
59- </ div >
60- </ CardContent >
61- </ Card >
82+ </ CardContent >
83+ </ Card >
6284
63- { /* Team Servers */ }
64- < Card className = "border-purple-200 bg-purple-50/50" >
65- < CardContent className = "p-4" >
66- < div className = "flex items-center justify-between" >
67- < div >
68- < p className = "text-sm font-medium text-purple-600" > Team Total</ p >
69- < p className = "text-2xl font-bold text-purple-900" > { teamStats . total } </ p >
70- </ div >
71- < div className = "h-8 w-8 bg-purple-100 rounded-full flex items-center justify-center" >
72- < Users className = "h-4 w-4 text-purple-600" />
85+ { /* Team Servers */ }
86+ < Card className = "border-purple-200 bg-purple-50/50" >
87+ < CardContent className = "p-4" >
88+ < div className = "flex items-center justify-between" >
89+ < div >
90+ < p className = "text-sm font-medium text-purple-600" >
91+ Team Total
92+ </ p >
93+ < p className = "text-2xl font-bold text-purple-900" >
94+ { isAuthenticated ? teamStats . total : "--" }
95+ </ p >
96+ </ div >
97+ < div className = "h-8 w-8 bg-purple-100 rounded-full flex items-center justify-center" >
98+ < Users className = "h-4 w-4 text-purple-600" />
99+ </ div >
73100 </ div >
74- </ div >
75- </ CardContent >
76- </ Card >
77- </ div >
101+ </ CardContent >
102+ </ Card >
103+ </ div >
104+
105+ { ! isAuthenticated && (
106+ < Card className = "border-dashed border-2 border-yellow-300 bg-yellow-50/50 col-span-full" >
107+ < CardContent className = "p-4 text-center" >
108+ < p className = "text-sm font-medium text-yellow-700" >
109+ Pro & Team Features
110+ </ p >
111+ < p className = "text-lg font-semibold text-yellow-900" >
112+ Unlock cloud sync, multi-device access, and advanced templates
113+ </ p >
114+ < Button
115+ variant = "outline"
116+ className = "mt-2"
117+ onClick = { ( ) => navigate ( "/auth" ) }
118+ >
119+ Login to Explore
120+ </ Button >
121+ </ CardContent >
122+ </ Card >
123+ ) }
124+ </ >
78125 ) ;
79126} ;
0 commit comments