diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx new file mode 100644 index 0000000..9709342 --- /dev/null +++ b/src/app/admin/page.tsx @@ -0,0 +1,349 @@ +"use client"; + +import { useState } from "react"; +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarStyleCentered from "@/components/navbar/NavbarStyleCentered/NavbarStyleCentered"; +import FooterBase from "@/components/sections/footer/FooterBase"; +import { Users, Briefcase, BarChart3, ChevronDown, Plus, Trash2, Edit2 } from "lucide-react"; + +const navItems = [ + { name: "Dashboard", id: "/admin" }, + { name: "Jobs", id: "/admin" }, + { name: "Users", id: "/admin" }, + { name: "Analytics", id: "/admin" }, + { name: "Home", id: "/" }, +]; + +const footerColumns = [ + { + title: "Product", items: [ + { label: "Search Jobs", href: "/search" }, + { label: "Post a Job", href: "/post-job" }, + { label: "Browse by Province", href: "#provinces" }, + { label: "For Employers", href: "#" }, + ], + }, + { + title: "Company", items: [ + { label: "About Jobee", href: "#about" }, + { label: "Careers", href: "#" }, + { label: "Contact Us", href: "#contact" }, + { label: "Blog", href: "#" }, + ], + }, + { + title: "Resources", items: [ + { label: "Privacy Policy", href: "#" }, + { label: "Terms of Service", href: "#" }, + { label: "FAQ", href: "#" }, + { label: "Support", href: "#" }, + ], + }, +]; + +interface Job { + id: string; + title: string; + company: string; + location: string; + status: "active" | "closed"; + applications: number; + postedDate: string; +} + +interface User { + id: string; + name: string; + email: string; + role: "job_seeker" | "employer"; + joinDate: string; + status: "active" | "inactive"; +} + +interface AnalyticsData { + totalJobs: number; + totalUsers: number; + activeApplications: number; + successfulPlacements: number; +} + +export default function AdminDashboard() { + const [activeTab, setActiveTab] = useState<"dashboard" | "jobs" | "users">("dashboard"); + const [jobs, setJobs] = useState([ + { + id: "1", title: "Senior React Developer", company: "TechCorp", location: "Amsterdam", status: "active", applications: 24, + postedDate: "2025-01-10"}, + { + id: "2", title: "UX Designer", company: "DesignStudio", location: "Rotterdam", status: "active", applications: 18, + postedDate: "2025-01-08"}, + { + id: "3", title: "Backend Engineer", company: "DataSystems", location: "Utrecht", status: "closed", applications: 42, + postedDate: "2024-12-20"}, + ]); + + const [users, setUsers] = useState([ + { + id: "1", name: "Alice Johnson", email: "alice@example.com", role: "job_seeker", joinDate: "2024-11-15", status: "active"}, + { + id: "2", name: "Bob Smith", email: "bob@example.com", role: "employer", joinDate: "2024-10-20", status: "active"}, + { + id: "3", name: "Carol White", email: "carol@example.com", role: "job_seeker", joinDate: "2024-09-05", status: "inactive"}, + ]); + + const [analytics] = useState({ + totalJobs: 156, + totalUsers: 3245, + activeApplications: 892, + successfulPlacements: 142, + }); + + const handleDeleteJob = (id: string) => { + setJobs(jobs.filter((job) => job.id !== id)); + }; + + const handleDeleteUser = (id: string) => { + setUsers(users.filter((user) => user.id !== id)); + }; + + return ( + + + +
+
+ {/* Header */} +
+

Admin Dashboard

+

Manage jobs, users, and view analytics

+
+ + {/* Tab Navigation */} +
+ + + +
+ + {/* Dashboard Tab */} + {activeTab === "dashboard" && ( +
+
+
+
+

Total Jobs

+

{analytics.totalJobs}

+
+ +
+
+
+
+
+

Total Users

+

{analytics.totalUsers}

+
+ +
+
+
+
+
+

Active Applications

+

{analytics.activeApplications}

+
+ +
+
+
+
+
+

Successful Placements

+

{analytics.successfulPlacements}

+
+ +
+
+
+ )} + + {/* Jobs Tab */} + {activeTab === "jobs" && ( +
+
+

Job Management

+ +
+
+ + + + + + + + + + + + + {jobs.map((job) => ( + + + + + + + + + ))} + +
TitleCompanyLocationStatusApplicationsActions
{job.title}{job.company}{job.location} + + {job.status.charAt(0).toUpperCase() + job.status.slice(1)} + + {job.applications} + + +
+
+
+ )} + + {/* Users Tab */} + {activeTab === "users" && ( +
+
+

User Management

+ +
+
+ + + + + + + + + + + + + {users.map((user) => ( + + + + + + + + + ))} + +
NameEmailRoleJoin DateStatusActions
{user.name}{user.email} + {user.role.replace("_", " ")} + {user.joinDate} + + {user.status.charAt(0).toUpperCase() + user.status.slice(1)} + + + + +
+
+
+ )} +
+
+ + +
+ ); +}