diff --git a/client/pages/staff/StaffAchievements.tsx b/client/pages/staff/StaffAchievements.tsx new file mode 100644 index 00000000..36ffa3c4 --- /dev/null +++ b/client/pages/staff/StaffAchievements.tsx @@ -0,0 +1,176 @@ +import { useEffect, useState } from "react"; +import Layout from "@/components/Layout"; +import { useAuth } from "@/contexts/AuthContext"; +import { useNavigate } from "react-router-dom"; +import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Progress } from "@/components/ui/progress"; +import { Trophy, Zap, Users, Target } from "lucide-react"; + +interface Achievement { + id: string; + title: string; + description: string; + icon: string; + earned: boolean; + earnedDate?: string; + progress?: number; +} + +export default function StaffAchievements() { + const { user, loading } = useAuth(); + const navigate = useNavigate(); + const [achievements, setAchievements] = useState([ + { + id: "1", + title: "Team Contributor", + description: "Contribute to 5 team projects", + icon: "Users", + earned: true, + earnedDate: "2025-01-15", + }, + { + id: "2", + title: "Code Master", + description: "100+ commits to main repository", + icon: "Zap", + earned: false, + progress: 67, + }, + { + id: "3", + title: "Documentation Champion", + description: "Complete internal documentation setup", + icon: "Target", + earned: true, + earnedDate: "2025-01-10", + }, + { + id: "4", + title: "Mentor", + description: "Mentor 3 team members", + icon: "Trophy", + earned: false, + progress: 33, + }, + ]); + + useEffect(() => { + if (!loading && !user) { + navigate("/staff/login"); + } + }, [user, loading, navigate]); + + if (loading) return
Loading...
; + + return ( + +
+
+
+

Achievements

+

Track team accomplishments and milestones

+
+ + {/* Stats */} +
+ + +
Total Achievements
+
4
+
+
+ + + +
Earned
+
2
+
+
+ + + +
In Progress
+
2
+
+
+ + + +
Completion Rate
+
50%
+
+
+
+ + {/* Achievements Grid */} +
+ {achievements.map((achievement) => ( + + +
+
+
+ +
+
+ + {achievement.title} + + + {achievement.description} + +
+
+ {achievement.earned && ( + + Earned + + )} +
+
+ + {!achievement.earned && achievement.progress !== undefined && ( +
+
+ Progress + + {achievement.progress}% + +
+ +
+ )} + {achievement.earnedDate && ( +

+ Earned on {new Date(achievement.earnedDate).toLocaleDateString()} +

+ )} +
+
+ ))} +
+
+
+
+ ); +}