From e690205c620d5d5916671a03a261f9bb09726dd9 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 11 Nov 2025 01:51:44 +0000 Subject: [PATCH] Remove Staff.tsx - consolidating into Admin cgen-d4b4630792bd4ad7845f599a7eedbd34 --- client/pages/Staff.tsx | 263 --------------- client/pages/StaffDashboard.tsx | 411 ----------------------- client/pages/StaffLogin.tsx | 205 ----------- client/pages/staff/StaffAchievements.tsx | 204 ----------- client/pages/staff/StaffAdmin.tsx | 195 ----------- client/pages/staff/StaffChat.tsx | 237 ------------- client/pages/staff/StaffDirectory.tsx | 192 ----------- client/pages/staff/StaffDocs.tsx | 183 ---------- 8 files changed, 1890 deletions(-) delete mode 100644 client/pages/Staff.tsx delete mode 100644 client/pages/StaffDashboard.tsx delete mode 100644 client/pages/StaffLogin.tsx delete mode 100644 client/pages/staff/StaffAchievements.tsx delete mode 100644 client/pages/staff/StaffAdmin.tsx delete mode 100644 client/pages/staff/StaffChat.tsx delete mode 100644 client/pages/staff/StaffDirectory.tsx delete mode 100644 client/pages/staff/StaffDocs.tsx diff --git a/client/pages/Staff.tsx b/client/pages/Staff.tsx deleted file mode 100644 index 9d213b98..00000000 --- a/client/pages/Staff.tsx +++ /dev/null @@ -1,263 +0,0 @@ -import { useEffect } from "react"; -import { useNavigate } from "react-router-dom"; -import Layout from "@/components/Layout"; -import SEO from "@/components/SEO"; -import { useAuth } from "@/contexts/AuthContext"; -import { Button } from "@/components/ui/button"; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card"; -import { Badge } from "@/components/ui/badge"; -import { Lock, Users, FileText, Zap, Award, MessageSquare } from "lucide-react"; - -export default function Staff() { - const { user, loading } = useAuth(); - const navigate = useNavigate(); - - useEffect(() => { - if (!loading && user) { - navigate("/admin", { replace: true }); - } - }, [user, loading, navigate]); - - return ( - - - -
- {/* Animated background */} -
-
-
-
-
- -
- {/* Hero Section */} -
- - Internal Platform - - -

- AeThex Staff -

- -

- The internal hub for AeThex employees and authorized contractors. - Unified access to dashboards, tools, documentation, and - collaboration features. -

- -
- - -
-
- - {/* Features Grid */} -
-

- Staff Tools & Features -

- -
- {/* Dashboard */} - - -
-
- -
- Dashboard -
-
- - - Real-time operations metrics, service status, and quick - access to common tools. - - -
- - {/* Directory */} - - -
-
- -
- Directory -
-
- - - Browse team members, view profiles, and find contact - information. - - -
- - {/* Admin Tools */} - - -
-
- -
- - Admin Tools - -
-
- - - Manage users, roles, permissions, and platform - configuration. - - -
- - {/* Docs */} - - -
-
- -
- Docs & API -
-
- - - Internal documentation, API keys, credentials, and setup - guides. - - -
- - {/* Achievements */} - - -
-
- -
- - Achievements - -
-
- - - Track team accomplishments, milestones, and performance - metrics. - - -
- - {/* Collaboration */} - - -
-
- -
- - Collaboration - -
-
- - - Internal chat, team discussions, and project coordination. - - -
-
-
- - {/* Info Section */} -
-
-
-

- Who Can Access? -

-
    -
  • - - AeThex employees (@aethex.dev) -
  • -
  • - - Authorized contractors (invited) -
  • -
  • - - Partners with special access -
  • -
-
- -
-

- Getting Started -

-
    -
  1. - 1. - Click "Staff Login" to sign in with Google -
  2. -
  3. - 2. - Use your @aethex.dev email address -
  4. -
  5. - 3. - Access your personalized dashboard -
  6. -
-
-
-
- - {/* Footer CTA */} -
-

- Not a staff member? Visit the public platform. -

- -
-
-
- - ); -} diff --git a/client/pages/StaffDashboard.tsx b/client/pages/StaffDashboard.tsx deleted file mode 100644 index cce6d395..00000000 --- a/client/pages/StaffDashboard.tsx +++ /dev/null @@ -1,411 +0,0 @@ -import React, { useEffect, useMemo, useState } from "react"; -import Layout from "@/components/Layout"; -import { useAuth } from "@/contexts/AuthContext"; -import { useNavigate } from "react-router-dom"; -import { aethexToast } from "@/lib/aethex-toast"; -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card"; -import { Badge } from "@/components/ui/badge"; -import { Button } from "@/components/ui/button"; -import { Separator } from "@/components/ui/separator"; - -function useHasStaffAccess(roles: string[]) { - return useMemo( - () => - roles.some((r) => - ["owner", "admin", "founder", "staff", "employee"].includes( - r.toLowerCase(), - ), - ), - [roles], - ); -} - -export default function StaffDashboard() { - const { user, roles, loading } = useAuth(); - const navigate = useNavigate(); - const hasAccess = useHasStaffAccess(roles); - - useEffect(() => { - if (loading) return; - if (!user) { - aethexToast.info({ - title: "Sign in required", - description: "Staff area requires authentication", - }); - navigate("/admin"); - return; - } - if (!hasAccess) { - aethexToast.error({ - title: "Access denied", - description: "You don't have staff permissions", - }); - navigate("/dashboard"); - } - }, [user, roles, hasAccess, loading, navigate]); - - const [activeTab, setActiveTab] = useState("overview"); - const [openReports, setOpenReports] = useState([]); - const [mentorshipAll, setMentorshipAll] = useState([]); - const [loadingData, setLoadingData] = useState(false); - const [searchQ, setSearchQ] = useState(""); - const [users, setUsers] = useState([]); - - const refresh = async () => { - setLoadingData(true); - try { - const [r1, r2] = await Promise.all([ - fetch("/api/moderation/reports?status=open&limit=100"), - fetch("/api/mentorship/requests/all?limit=50&status=pending"), - ]); - const reports = r1.ok ? await r1.json() : []; - const m = r2.ok ? await r2.json() : []; - setOpenReports(Array.isArray(reports) ? reports : []); - setMentorshipAll(Array.isArray(m) ? m : []); - } catch (e) { - /* ignore */ - } finally { - setLoadingData(false); - } - }; - - useEffect(() => { - if (user && hasAccess) refresh(); - }, [user, hasAccess]); - - const loadUsers = async () => { - try { - const params = new URLSearchParams(); - if (searchQ.trim()) params.set("q", searchQ.trim()); - params.set("limit", "25"); - const resp = await fetch(`/api/staff/users?${params.toString()}`); - const data = resp.ok ? await resp.json() : []; - setUsers(Array.isArray(data) ? data : []); - } catch { - setUsers([]); - } - }; - - const updateReportStatus = async ( - id: string, - status: "resolved" | "ignored" | "open", - ) => { - try { - const resp = await fetch( - `/api/moderation/reports/${encodeURIComponent(id)}/status`, - { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ status }), - }, - ); - if (resp.ok) { - aethexToast.success({ - title: "Updated", - description: `Report marked ${status}`, - }); - refresh(); - } - } catch {} - }; - - return ( - -
-
- - Internal - -

Operations Command

-

- Staff dashboards, moderation, and internal tools. -

-
- - - - Overview - Moderation - Mentorship - Users - - - -
- - - Community Health - - Quick pulse across posts and reports - - - -
-
- Open reports -
-
- {openReports.length} -
-
-
-
- Mentorship requests -
-
- {mentorshipAll.length} -
-
-
-
- - - Service Status - APIs and queues - - -
-
- Admin API -
- OK -
-
-
- Notifications -
- OK -
-
-
- - - Staff Resources - Knowledge & HR tools - - - - - - - - -
- -
- - - Operations - Tracking and management - - - - - - - - - Employee Services - HR and financial tools - - - - - - - -
-
- - - - - Moderation Queue - Flagged content and actions - - - {loadingData && ( -

Loading…

- )} - {!loadingData && openReports.length === 0 && ( -

- No items in queue. -

- )} -
- {openReports.map((r) => ( -
-
-
-
{r.reason}
-
- {r.details} -
-
-
- - -
-
-
- ))} -
-
-
-
- - - - - Mentorship Requests - - Review recent mentor/mentee activity - - - - {loadingData && ( -

Loading…

- )} - {!loadingData && mentorshipAll.length === 0 && ( -

- No requests to review. -

- )} -
- {mentorshipAll.map((req) => ( -
-
-
-
- {req.mentee?.full_name || req.mentee?.username} →{" "} - {req.mentor?.full_name || req.mentor?.username} -
-
- {req.message || "No message"} -
-
-
- - {req.status} - -
-
-
- ))} -
- - -
-
-
- - - - - Users - - Search, roles, and quick actions - - - -
- setSearchQ(e.target.value)} - /> - -
-
- {users.length === 0 ? ( -

- No users found. -

- ) : ( -
- {users.map((u) => ( -
-
-
- {u.full_name || u.username || u.id} -
-
- {u.username} -
-
- - {u.user_type || "unknown"} - -
- ))} -
- )} -
-
-
-
-
-
-
- ); -} diff --git a/client/pages/StaffLogin.tsx b/client/pages/StaffLogin.tsx deleted file mode 100644 index 7833b4cc..00000000 --- a/client/pages/StaffLogin.tsx +++ /dev/null @@ -1,205 +0,0 @@ -import { useEffect, useState } from "react"; -import { useNavigate, useLocation } from "react-router-dom"; -import { useAuth } from "@/contexts/AuthContext"; -import { useAethexToast } from "@/hooks/use-aethex-toast"; -import Layout from "@/components/Layout"; -import SEO from "@/components/SEO"; -import { Button } from "@/components/ui/button"; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from "@/components/ui/card"; -import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; -import LoadingScreen from "@/components/LoadingScreen"; -import { LogIn, Lock, Users } from "lucide-react"; - -const GoogleIcon = () => ( - - - - - - -); - -export default function StaffLogin() { - const [isLoading, setIsLoading] = useState(false); - const [errorFromUrl, setErrorFromUrl] = useState(null); - const navigate = useNavigate(); - const location = useLocation(); - const { signInWithOAuth, user, loading, profileComplete } = useAuth(); - const { error: toastError, info: toastInfo } = useAethexToast(); - - // Check for error messages from URL (e.g., from OAuth callbacks) - useEffect(() => { - const params = new URLSearchParams(location.search); - const errorType = params.get("error"); - const errorMessage = params.get("message"); - - if (errorType && errorMessage) { - setErrorFromUrl(decodeURIComponent(errorMessage)); - if (errorType === "domain_not_allowed") { - toastError({ - title: "Access Denied", - description: errorMessage, - }); - } - } - }, [location.search, toastError]); - - // Redirect if already authenticated (with @aethex.dev email validation) - useEffect(() => { - if (!loading && user) { - const userEmail = user.email || ""; - const isAethexDev = userEmail.endsWith("@aethex.dev"); - - if (!isAethexDev) { - // Email is not @aethex.dev - show error - setErrorFromUrl( - "Only @aethex.dev email addresses can access the Staff Portal. If you're an authorized contractor, please use your assigned contractor email.", - ); - toastError({ - title: "Access Denied", - description: "This email domain is not authorized for staff access.", - }); - return; - } - - // Valid staff email - redirect to admin dashboard - const params = new URLSearchParams(location.search); - const next = params.get("next"); - const safeNext = next && next.startsWith("/admin") ? next : null; - navigate(safeNext || "/admin", { replace: true }); - } - }, [user, loading, navigate, location.search, toastError]); - - const handleGoogleSignIn = async () => { - setIsLoading(true); - try { - // Pass the admin dashboard as the intended destination after OAuth completes - await signInWithOAuth("google", "/admin"); - } catch (error: any) { - console.error("Google sign-in error:", error); - toastError({ - title: "Sign-in failed", - description: - error?.message || "Failed to sign in with Google. Please try again.", - }); - } finally { - setIsLoading(false); - } - }; - - if (loading) { - return ; - } - - return ( - - - -
-
-
-
-
- -
- - -
-
- -
-
- Staff Portal - - AeThex employees and authorized contractors only - -
- - - {errorFromUrl && ( - - Access Denied - {errorFromUrl} - - )} - -
-

- Sign in with your @aethex.dev Google Workspace account -

- - -
- -
-
-
-
-
- - For team members only - -
-
- -
-
- - Full access to internal tools and dashboards -
-
- - Secured with Google Workspace authentication -
-
- -
-

- Public login available at{" "} - - aethex.dev/login - -

-
- - -
-
- - ); -} diff --git a/client/pages/staff/StaffAchievements.tsx b/client/pages/staff/StaffAchievements.tsx deleted file mode 100644 index 9c49370b..00000000 --- a/client/pages/staff/StaffAchievements.tsx +++ /dev/null @@ -1,204 +0,0 @@ -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("/admin"); - } - }, [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()} -

- )} -
-
- ))} -
-
-
-
- ); -} diff --git a/client/pages/staff/StaffAdmin.tsx b/client/pages/staff/StaffAdmin.tsx deleted file mode 100644 index 5263cfa4..00000000 --- a/client/pages/staff/StaffAdmin.tsx +++ /dev/null @@ -1,195 +0,0 @@ -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("/admin"); - return; - } - const isAdmin = roles?.some((r) => - ["owner", "admin", "founder"].includes(r.toLowerCase()), - ); - if (!isAdmin) { - navigate("/admin"); - } - }, [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 - -
-
-
- - - -
-
-
-
-
- ); -} diff --git a/client/pages/staff/StaffChat.tsx b/client/pages/staff/StaffChat.tsx deleted file mode 100644 index 0c2d7d70..00000000 --- a/client/pages/staff/StaffChat.tsx +++ /dev/null @@ -1,237 +0,0 @@ -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 { Button } from "@/components/ui/button"; -import { Badge } from "@/components/ui/badge"; -import { MessageSquare, Users, Hash, Lock, Plus } from "lucide-react"; - -const channels = [ - { - name: "announcements", - description: "Company announcements and updates", - type: "public", - members: 45, - }, - { - name: "engineering", - description: "Engineering team discussions", - type: "private", - members: 12, - }, - { - name: "product", - description: "Product and feature discussions", - type: "public", - members: 28, - }, - { - name: "design", - description: "Design and UX team", - type: "private", - members: 8, - }, - { - name: "random", - description: "Off-topic and casual chat", - type: "public", - members: 42, - }, -]; - -const directMessages = [ - { name: "Sarah Johnson", role: "CEO", status: "online" }, - { name: "Mike Chen", role: "CTO", status: "online" }, - { name: "Emma Davis", role: "Product Lead", status: "away" }, - { name: "Alex Kim", role: "Designer", status: "offline" }, -]; - -export default function StaffChat() { - const { user, loading } = useAuth(); - const navigate = useNavigate(); - - useEffect(() => { - if (!loading && !user) { - navigate("/admin"); - } - }, [user, loading, navigate]); - - if (loading) - return ( - -
Loading...
-
- ); - - return ( - -
-
-
-

Team Chat

-

- Internal collaboration and team discussions -

-
- -
- {/* Sidebar */} -
- {/* Channels */} -
-
-

- - Channels -

- -
-
- {channels.map((channel) => ( - - ))} -
-
- - {/* DMs */} -
-
-

- - Direct Messages -

- -
-
- {directMessages.map((dm) => ( - - ))} -
-
-
- - {/* Main Chat Area */} -
- {/* Channel Info */} - - -
-
- - - announcements - - - Company announcements and updates - -
- - 45 members - -
-
-
- - {/* Messages Area */} - - -
-
-
-

- Sarah Johnson -

-

- Welcome to the internal team chat! This is where we - collaborate and share updates. -

-

10:30 AM

-
-
- -
-
-
-

- Mike Chen -

-

- Great! Looking forward to building amazing things - together. -

-

10:35 AM

-
-
- - -
-
- - -
-
- - - {/* Info */} - - - - - Team Chat Coming Soon - - - -

• Full-featured internal messaging platform

-

• Channels for teams and projects

-

• Direct messages and group chats

-

• File sharing and integrations

-
-
-
-
-
-
- - ); -} diff --git a/client/pages/staff/StaffDirectory.tsx b/client/pages/staff/StaffDirectory.tsx deleted file mode 100644 index ae8493d4..00000000 --- a/client/pages/staff/StaffDirectory.tsx +++ /dev/null @@ -1,192 +0,0 @@ -import { useEffect, useState } from "react"; -import Layout from "@/components/Layout"; -import { useAuth } from "@/contexts/AuthContext"; -import { useNavigate } from "react-router-dom"; -import { aethexToast } from "@/lib/aethex-toast"; -import { Button } from "@/components/ui/button"; -import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { Badge } from "@/components/ui/badge"; -import { Input } from "@/components/ui/input"; -import { Search, Mail, Phone, Briefcase } from "lucide-react"; - -interface StaffMember { - id: string; - full_name: string; - email: string; - role: string; - department?: string; - position?: string; - avatar_url?: string; - phone?: string; -} - -export default function StaffDirectory() { - const { user, loading } = useAuth(); - const navigate = useNavigate(); - const [staffMembers, setStaffMembers] = useState([]); - const [filteredMembers, setFilteredMembers] = useState([]); - const [searchQuery, setSearchQuery] = useState(""); - const [isLoading, setIsLoading] = useState(true); - - useEffect(() => { - if (!loading && !user) { - navigate("/admin"); - } - }, [user, loading, navigate]); - - useEffect(() => { - const fetchMembers = async () => { - try { - const response = await fetch("/api/staff/members"); - if (response.ok) { - const data = await response.json(); - setStaffMembers(Array.isArray(data) ? data : []); - setFilteredMembers(Array.isArray(data) ? data : []); - } else { - aethexToast.error({ - title: "Failed to load directory", - description: "Could not fetch staff members", - }); - } - } catch (error) { - console.error("Error fetching staff members:", error); - aethexToast.error({ - title: "Error", - description: "Failed to load staff directory", - }); - } finally { - setIsLoading(false); - } - }; - - if (user) fetchMembers(); - }, [user]); - - useEffect(() => { - if (searchQuery.trim() === "") { - setFilteredMembers(staffMembers); - } else { - const query = searchQuery.toLowerCase(); - const filtered = staffMembers.filter( - (member) => - member.full_name.toLowerCase().includes(query) || - member.email.toLowerCase().includes(query) || - member.department?.toLowerCase().includes(query), - ); - setFilteredMembers(filtered); - } - }, [searchQuery, staffMembers]); - - if (loading) - return ( - -
Loading...
-
- ); - - return ( - -
-
-
-

- Team Directory -

-

- Find and connect with AeThex team members -

-
- - {/* Search Bar */} - - -
- - setSearchQuery(e.target.value)} - className="pl-10 bg-slate-800 border-slate-700 text-white placeholder-slate-500" - /> -
-
-
- - {/* Results */} - {isLoading ? ( -
- Loading team members... -
- ) : filteredMembers.length === 0 ? ( -
- No staff members found matching your search -
- ) : ( -
- {filteredMembers.map((member) => ( - - -
-
- - {member.full_name} - -

- {member.position || "Team Member"} -

-
- {member.role && ( - - {member.role} - - )} -
-
- - - {member.phone && ( - - )} - {member.department && ( -
- - {member.department} -
- )} -
-
- ))} -
- )} - - {/* Stats */} -
-

- Showing {filteredMembers.length} of {staffMembers.length} team - members -

-
-
-
-
- ); -} diff --git a/client/pages/staff/StaffDocs.tsx b/client/pages/staff/StaffDocs.tsx deleted file mode 100644 index b704a0bc..00000000 --- a/client/pages/staff/StaffDocs.tsx +++ /dev/null @@ -1,183 +0,0 @@ -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 { Button } from "@/components/ui/button"; -import { Badge } from "@/components/ui/badge"; -import { FileText, Key, Database, Code2, ExternalLink } from "lucide-react"; - -export default function StaffDocs() { - const { user, loading } = useAuth(); - const navigate = useNavigate(); - - useEffect(() => { - if (!loading && !user) { - navigate("/admin"); - } - }, [user, loading, navigate]); - - if (loading) - return ( - -
Loading...
-
- ); - - const docs = [ - { - icon: FileText, - title: "Getting Started", - description: "Onboarding guide and platform overview", - link: "#", - }, - { - icon: Code2, - title: "API Reference", - description: "Complete API documentation and endpoints", - link: "#", - }, - { - icon: Database, - title: "Database Schema", - description: "Database structure and relationships", - link: "#", - }, - { - icon: Key, - title: "Authentication", - description: "OAuth, tokens, and security guidelines", - link: "#", - }, - ]; - - const apiKeys = [ - { name: "Public API Key", key: "pk_aethex_...", status: "active" }, - { name: "Secret API Key", key: "sk_aethex_...", status: "active" }, - { name: "Webhook Secret", key: "whk_aethex_...", status: "active" }, - ]; - - return ( - -
-
-
-

- Documentation & API -

-

- Internal docs, API keys, and credentials -

-
- - {/* Documentation */} -
-

- Documentation -

-
- {docs.map((doc, idx) => { - const IconComponent = doc.icon; - return ( - - -
-
-
- -
-
- - {doc.title} - - - {doc.description} - -
-
-
-
- - - -
- ); - })} -
-
- - {/* API Keys */} -
-
-

API Keys

- - Keep secure - -
- - -
- {apiKeys.map((key, idx) => ( -
-
-

{key.name}

-

- {key.key} -

-
-
- - {key.status} - - -
-
- ))} -
- -
-
-
- - {/* Security Notice */} - - - 🔐 Security Notice - - -

• Never share API keys in public channels or repositories

-

• Rotate keys regularly for security

-

• Use secrets management for production deployments

-

• Report compromised keys immediately

-
-
-
-
-
- ); -}