diff --git a/client/pages/staff/StaffAdmin.tsx b/client/pages/staff/StaffAdmin.tsx new file mode 100644 index 00000000..00346b6b --- /dev/null +++ b/client/pages/staff/StaffAdmin.tsx @@ -0,0 +1,163 @@ +import { useEffect } 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 { Button } from "@/components/ui/button"; +import { Users, Shield, Settings, GitBranch, Eye, RefreshCw } from "lucide-react"; + +export default function StaffAdmin() { + const { user, roles, loading } = useAuth(); + const navigate = useNavigate(); + + useEffect(() => { + if (!loading && !user) { + navigate("/staff/login"); + return; + } + const isAdmin = roles?.some((r) => + ["owner", "admin", "founder"].includes(r.toLowerCase()) + ); + if (!isAdmin) { + navigate("/staff/dashboard"); + } + }, [user, roles, loading, navigate]); + + if (loading) return
Loading...
; + + return ( + +
+
+
+

Admin Tools

+

Manage users, roles, and platform configuration

+
+ +
+ {/* User Management */} + + +
+
+ + + Users + + Manage team members and roles +
+
+
+ + + +
+ + {/* Permissions */} + + +
+
+ + + Permissions + + Configure role-based access +
+
+
+ + + +
+ + {/* Settings */} + + +
+
+ + + Settings + + Platform configuration +
+
+
+ + + +
+ + {/* API Keys */} + + +
+
+ + + API Keys + + Manage authentication tokens +
+
+
+ + + +
+ + {/* Audit Log */} + + +
+
+ + + Audit Log + + Platform activity history +
+
+
+ + + +
+ + {/* Maintenance */} + + +
+
+ + + Maintenance + + System operations +
+
+
+ + + +
+
+
+
+
+ ); +}