From b315bbbcc06972315ea3c253d62b8511fee433d0 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 11 Nov 2025 01:57:33 +0000 Subject: [PATCH] Create AdminStaffOperations component (from StaffDashboard) cgen-234b7a858d5f45fc855e78c41d6073fd --- .../components/admin/AdminStaffOperations.tsx | 326 ++++++++++++++++++ 1 file changed, 326 insertions(+) create mode 100644 client/components/admin/AdminStaffOperations.tsx diff --git a/client/components/admin/AdminStaffOperations.tsx b/client/components/admin/AdminStaffOperations.tsx new file mode 100644 index 00000000..ac9f2fa8 --- /dev/null +++ b/client/components/admin/AdminStaffOperations.tsx @@ -0,0 +1,326 @@ +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Badge } from "@/components/ui/badge"; +import { AlertCircle, CheckCircle2, Clock, Users, TrendingUp } from "lucide-react"; +import { useState } from "react"; + +interface Report { + id: string; + type: string; + reporter: string; + subject: string; + status: "open" | "in-review" | "resolved"; + severity: "low" | "medium" | "high" | "critical"; + reportedAt: string; +} + +interface MentorshipRequest { + id: string; + mentee: string; + mentor: string; + status: "pending" | "accepted" | "completed"; + topic: string; + requestedAt: string; +} + +interface User { + id: string; + name: string; + email: string; + status: "active" | "inactive" | "pending"; + joinedAt: string; + lastActive: string; +} + +export default function AdminStaffOperations() { + const [operationTab, setOperationTab] = useState("overview"); + + const reports: Report[] = [ + { + id: "1", + type: "Content Violation", + reporter: "Sam Patel", + subject: "Inappropriate post in #general", + status: "in-review", + severity: "high", + reportedAt: "2024-01-15 10:30", + }, + { + id: "2", + type: "User Conduct", + reporter: "Taylor Kim", + subject: "Harassment in mentorship session", + status: "open", + severity: "critical", + reportedAt: "2024-01-15 14:20", + }, + { + id: "3", + type: "Content Violation", + reporter: "Jordan Martinez", + subject: "Spam in #opportunities", + status: "resolved", + severity: "low", + reportedAt: "2024-01-14 11:45", + }, + ]; + + const mentorshipRequests: MentorshipRequest[] = [ + { + id: "1", + mentee: "Alex Kim", + mentor: "Jordan Martinez", + status: "accepted", + topic: "Advanced React Patterns", + requestedAt: "2024-01-10", + }, + { + id: "2", + mentee: "Casey Zhang", + mentor: "Sam Patel", + status: "pending", + topic: "Community Building", + requestedAt: "2024-01-15", + }, + { + id: "3", + mentee: "Morgan Lee", + mentor: "Taylor Kim", + status: "completed", + topic: "Operations Management", + requestedAt: "2024-01-01", + }, + ]; + + const users: User[] = [ + { + id: "1", + name: "Alex Chen", + email: "alex@aethex.dev", + status: "active", + joinedAt: "2023-01-01", + lastActive: "2 minutes ago", + }, + { + id: "2", + name: "Jordan Martinez", + email: "jordan@aethex.dev", + status: "active", + joinedAt: "2023-02-15", + lastActive: "1 hour ago", + }, + { + id: "3", + name: "Sam Patel", + email: "sam@aethex.dev", + status: "active", + joinedAt: "2023-06-01", + lastActive: "3 hours ago", + }, + { + id: "4", + name: "Casey Zhang", + email: "casey@aethex.dev", + status: "pending", + joinedAt: "2024-01-10", + lastActive: "Never", + }, + ]; + + const getSeverityColor = (severity: Report["severity"]) => { + const colors: Record = { + low: "bg-green-100 text-green-900 dark:bg-green-900/30", + medium: "bg-yellow-100 text-yellow-900 dark:bg-yellow-900/30", + high: "bg-orange-100 text-orange-900 dark:bg-orange-900/30", + critical: "bg-red-100 text-red-900 dark:bg-red-900/30", + }; + return colors[severity]; + }; + + const getStatusIcon = (status: string) => { + const icons: Record = { + "open": , + "in-review": , + "resolved": , + "pending": , + "accepted": , + "completed": , + }; + return icons[status]; + }; + + const stats = [ + { label: "Active Users", value: 3, icon: Users }, + { label: "Open Reports", value: 2, icon: AlertCircle }, + { label: "Pending Requests", value: 1, icon: Clock }, + { label: "Completion Rate", value: "92%", icon: TrendingUp }, + ]; + + return ( +
+
+

Operations Dashboard

+

+ Moderation, mentorship, and user management +

+
+ + {/* Stats */} +
+ {stats.map((stat, i) => ( + + + + + {stat.label} + + + +
{stat.value}
+
+
+ ))} +
+ + {/* Tabs */} + + + Overview + Moderation + Mentorship + + + {/* Overview Tab */} + + + + System Status + Overall platform health and activity + + +
+

+ ✓ All systems operational +

+

+ API response time: 45ms | Uptime: 99.98% +

+
+
+
+

Active Sessions

+

127

+
+
+

Daily Active Users

+

342

+
+
+
+
+
+ + {/* Moderation Tab */} + + + + Reports & Moderation + Community reports and moderation actions + + + {reports.map((report) => ( +
+
+
+ {getStatusIcon(report.status)} +
+

{report.type}

+

+ Reported by {report.reporter} +

+
+
+ + {report.severity} + +
+

{report.subject}

+
+ {report.reportedAt} + {report.status} +
+
+ ))} +
+
+
+ + {/* Mentorship Tab */} + + + + Mentorship Program + Track mentorship requests and matches + + + {mentorshipRequests.map((req) => ( +
+
+
+

+ {req.mentee} → {req.mentor} +

+

+ {req.topic} +

+
+ {req.status} +
+

+ Requested {req.requestedAt} +

+
+ ))} +
+
+ + + + User Management + Current user status and activity + + +
+ {users.map((user) => ( +
+
+

{user.name}

+

+ {user.email} +

+
+
+ {user.status} +

+ {user.lastActive} +

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