diff --git a/client/pages/hub/ClientHub.tsx b/client/pages/hub/ClientHub.tsx new file mode 100644 index 00000000..ff8da904 --- /dev/null +++ b/client/pages/hub/ClientHub.tsx @@ -0,0 +1,377 @@ +import { useState, useEffect } from "react"; +import Layout from "@/components/Layout"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { useNavigate } from "react-router-dom"; +import { useAuth } from "@/contexts/AuthContext"; +import { + FileText, + Briefcase, + Clock, + AlertCircle, + TrendingUp, + BarChart3, + Settings, + LogOut, +} from "lucide-react"; +import { Badge } from "@/components/ui/badge"; + +export default function ClientHub() { + const navigate = useNavigate(); + const { user, signOut } = useAuth(); + const [isLoading, setIsLoading] = useState(true); + + useEffect(() => { + // Simulate loading + const timer = setTimeout(() => { + setIsLoading(false); + }, 500); + return () => clearTimeout(timer); + }, []); + + if (!user) { + return ( + +
+ + + Client Portal Access Required + + +

+ You must be signed in to access the Client Hub. +

+
+ + +
+
+
+
+
+ ); + } + + // Mock data for demonstration + const stats = [ + { + label: "Active Projects", + value: "3", + icon: Briefcase, + color: "bg-blue-500/10 text-blue-400", + }, + { + label: "Pending Invoices", + value: "$24,500", + icon: FileText, + color: "bg-amber-500/10 text-amber-400", + }, + { + label: "Active Contracts", + value: "5", + icon: FileText, + color: "bg-green-500/10 text-green-400", + }, + { + label: "Support Tickets", + value: "2", + icon: AlertCircle, + color: "bg-red-500/10 text-red-400", + }, + ]; + + const recentProjects = [ + { + id: 1, + name: "Roblox Game Development", + status: "In Progress", + progress: 65, + dueDate: "2025-02-28", + team: ["Alex Chen", "Jordan Smith"], + }, + { + id: 2, + name: "AI Integration Project", + status: "In Progress", + progress: 45, + dueDate: "2025-03-15", + team: ["Taylor Brown", "Casey Johnson"], + }, + { + id: 3, + name: "Mobile App Launch", + status: "On Hold", + progress: 30, + dueDate: "2025-04-01", + team: ["Morgan Davis"], + }, + ]; + + const menuItems = [ + { + icon: BarChart3, + label: "Dashboard", + path: "/hub/client/dashboard", + description: "Overview of all projects", + }, + { + icon: Briefcase, + label: "Projects", + path: "/hub/client/projects", + description: "View and manage projects", + }, + { + icon: FileText, + label: "Invoices", + path: "/hub/client/invoices", + description: "Track invoices and payments", + }, + { + icon: FileText, + label: "Contracts", + path: "/hub/client/contracts", + description: "Review contracts and agreements", + }, + { + icon: TrendingUp, + label: "Reports", + path: "/hub/client/reports", + description: "Project reports and analytics", + }, + { + icon: Settings, + label: "Settings", + path: "/hub/client/settings", + description: "Manage account preferences", + }, + ]; + + return ( + +
+ {/* Background */} +
+
+
+
+ +
+ {/* Header */} +
+
+
+

+ Client Portal +

+ +
+

+ Welcome, {user?.email || "Client"}. Manage your projects, + invoices, and agreements. +

+
+
+ + {/* Quick Stats */} +
+
+
+ {stats.map((stat) => { + const Icon = stat.icon; + return ( + + +
+
+

+ {stat.label} +

+

+ {stat.value} +

+
+
+ +
+
+
+
+ ); + })} +
+
+
+ + {/* Main Navigation Grid */} +
+
+

Quick Access

+
+ {menuItems.map((item) => { + const Icon = item.icon; + return ( + navigate(item.path)} + > + +
+
+ +
+
+

+ {item.label} +

+

+ {item.description} +

+
+
+
+
+ ); + })} +
+
+
+ + {/* Recent Projects */} +
+
+
+

Recent Projects

+ +
+
+ {recentProjects.map((project) => ( + + +
+
+

+ {project.name} +

+
+ + {project.status} + +
+ + Due {project.dueDate} +
+
+
+
+ + {/* Progress Bar */} +
+
+ + Progress + + + {project.progress}% + +
+
+
+
+
+ + {/* Team */} +
+
+ {project.team.map((member) => ( +
+ {member} +
+ ))} +
+ +
+ + + ))} +
+
+
+ + {/* Support Section */} +
+
+ + + Need Help? + + +

+ Contact our support team for assistance with your projects, + invoices, or any questions about your contracts. +

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