From d99e28ed887ede75c437cea5a129ad797961f2e6 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 11 Nov 2025 01:57:01 +0000 Subject: [PATCH] Create AdminStaffAdmin component cgen-a77cb9598e9746dfa17a04731344f6ba --- client/components/admin/AdminStaffAdmin.tsx | 301 ++++++++++++++++++++ 1 file changed, 301 insertions(+) create mode 100644 client/components/admin/AdminStaffAdmin.tsx diff --git a/client/components/admin/AdminStaffAdmin.tsx b/client/components/admin/AdminStaffAdmin.tsx new file mode 100644 index 00000000..f24570e1 --- /dev/null +++ b/client/components/admin/AdminStaffAdmin.tsx @@ -0,0 +1,301 @@ +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Users, Shield, Settings, Key, FileText, Wrench } from "lucide-react"; +import { useState } from "react"; + +interface User { + id: string; + name: string; + email: string; + role: string; + status: "active" | "inactive" | "suspended"; + joinDate: string; +} + +export default function AdminStaffAdmin() { + const [adminTab, setAdminTab] = useState("users"); + + const users: User[] = [ + { + id: "1", + name: "Alex Chen", + email: "alex@aethex.dev", + role: "Owner", + status: "active", + joinDate: "2023-01-01", + }, + { + id: "2", + name: "Jordan Martinez", + email: "jordan@aethex.dev", + role: "Admin", + status: "active", + joinDate: "2023-02-15", + }, + { + id: "3", + name: "Sam Patel", + email: "sam@aethex.dev", + role: "Staff", + status: "active", + joinDate: "2023-06-01", + }, + ]; + + const permissions = [ + { feature: "User Management", owner: true, admin: true, staff: false }, + { feature: "Content Moderation", owner: true, admin: true, staff: true }, + { feature: "Analytics", owner: true, admin: true, staff: true }, + { feature: "System Settings", owner: true, admin: false, staff: false }, + { feature: "API Keys", owner: true, admin: true, staff: false }, + { feature: "Audit Logs", owner: true, admin: true, staff: false }, + ]; + + const getStatusColor = (status: string) => { + const colors: Record = { + active: "bg-green-100 text-green-900 dark:bg-green-900/30 dark:text-green-200", + inactive: + "bg-gray-100 text-gray-900 dark:bg-gray-900/30 dark:text-gray-200", + suspended: + "bg-red-100 text-red-900 dark:bg-red-900/30 dark:text-red-200", + }; + return colors[status] || colors.inactive; + }; + + return ( +
+
+

Admin Management

+

+ User management, permissions, settings, and system tools +

+
+ + + + + + Users + + + + Permissions + + + + Settings + + + + API Keys + + + + Audit + + + + Maintenance + + + + {/* Users Tab */} + + + + User Management + Manage staff accounts and access + + +
+ {users.map((user) => ( +
+
+

{user.name}

+

{user.email}

+
+ {user.role} + + {user.status} + +
+
+
+ Joined {user.joinDate} +
+
+ ))} +
+
+
+
+ + {/* Permissions Tab */} + + + + Role Permissions + Define what each role can access + + +
+ + + + + + + + + + + {permissions.map((perm) => ( + + + + + + + ))} + +
FeatureOwnerAdminStaff
{perm.feature} + {perm.owner ? ( + + ✓ + + ) : ( + + )} + + {perm.admin ? ( + + ✓ + + ) : ( + + )} + + {perm.staff ? ( + + ✓ + + ) : ( + + )} +
+
+
+
+
+ + {/* Settings Tab */} + + + + System Settings + Configure global system parameters + + +
+ + +
+
+ + Enabled +
+
+ + Enabled +
+
+
+
+ + {/* API Keys Tab */} + + + + API Keys Management + Generate and revoke API keys + + + +

+ No active API keys. Generate one to get started. +

+
+
+
+ + {/* Audit Tab */} + + + + Audit Log + Track all administrative actions + + +
+
+

User Permissions Updated

+

+ Jordan Martinez role changed to Admin • 2 hours ago +

+
+
+

System Settings Modified

+

+ Session timeout changed to 24 hours • 1 day ago +

+
+
+
+
+
+ + {/* Maintenance Tab */} + + + + System Maintenance + Administrative tools and utilities + + + + + + + + + +
+
+ ); +}