diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index a283a4b..9709342 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -1,48 +1,108 @@ "use client"; +import { useState } from "react"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import NavbarStyleCentered from "@/components/navbar/NavbarStyleCentered/NavbarStyleCentered"; -import { useState } from "react"; -import { BarChart3, Users, Briefcase, FileText, TrendingUp, LogOut } from "lucide-react"; +import FooterBase from "@/components/sections/footer/FooterBase"; +import { Users, Briefcase, BarChart3, ChevronDown, Plus, Trash2, Edit2 } from "lucide-react"; const navItems = [ - { name: "Search Jobs", id: "" }, - { name: "Post a Job", id: "" }, - { name: "Admin", id: "/admin" }, - { name: "Browse", id: "" }, - { name: "Contact", id: "" }, + { name: "Dashboard", id: "/admin" }, + { name: "Jobs", id: "/admin" }, + { name: "Users", id: "/admin" }, + { name: "Analytics", id: "/admin" }, + { name: "Home", id: "/" }, ]; -type TabType = "jobs" | "applications" | "users" | "analytics"; +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("jobs"); - const [jobs] = useState([ - { id: 1, title: "Senior Developer", company: "Tech Corp", status: "Active", applications: 12, posted: "2 days ago" }, - { id: 2, title: "Product Manager", company: "Startup Inc", status: "Active", applications: 8, posted: "5 days ago" }, - { id: 3, title: "Designer", company: "Creative Agency", status: "Inactive", applications: 5, posted: "10 days ago" }, + 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 [applications] = useState([ - { id: 1, candidate: "John Smith", position: "Senior Developer", status: "Under Review", appliedDate: "2025-01-20" }, - { id: 2, candidate: "Sarah Johnson", position: "Product Manager", status: "Interview", appliedDate: "2025-01-19" }, - { id: 3, candidate: "Mike Davis", position: "Senior Developer", status: "Rejected", appliedDate: "2025-01-18" }, + 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 [users] = useState([ - { id: 1, name: "Alice Chen", email: "alice@example.com", role: "Job Seeker", joined: "2025-01-10", status: "Active" }, - { id: 2, name: "Bob Wilson", email: "bob@example.com", role: "Employer", joined: "2025-01-05", status: "Active" }, - { id: 3, name: "Carol White", email: "carol@example.com", role: "Job Seeker", joined: "2024-12-20", status: "Inactive" }, - ]); + const [analytics] = useState({ + totalJobs: 156, + totalUsers: 3245, + activeApplications: 892, + successfulPlacements: 142, + }); - const [analytics] = useState({ - totalJobs: 284, - activeApplications: 156, - totalUsers: 2341, - avgTimeToHire: "18 days", monthlyGrowth: "+12.5%", conversionRate: "8.3%"}); + const handleDeleteJob = (id: string) => { + setJobs(jobs.filter((job) => job.id !== id)); + }; - const handleLogout = () => { - window.location.href = "/"; + const handleDeleteUser = (id: string) => { + setUsers(users.filter((user) => user.id !== id)); }; return ( @@ -50,12 +110,12 @@ export default function AdminDashboard() { defaultButtonVariant="text-stagger" defaultTextAnimation="reveal-blur" borderRadius="pill" - contentWidth="medium" + contentWidth="smallMedium" sizing="mediumLargeSizeLargeTitles" - background="none" - cardStyle="solid" - primaryButtonStyle="gradient" - secondaryButtonStyle="solid" + background="circleGradient" + cardStyle="gradient-radial" + primaryButtonStyle="double-inset" + secondaryButtonStyle="glass" headingFontWeight="bold" > -
-
-

Admin Dashboard

+
+
+ {/* Header */} +
+

Admin Dashboard

+

Manage jobs, users, and view analytics

+
{/* Tab Navigation */} -
+
-
- {/* Job Management Tab */} + {/* 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 Listings

-
-
+
- + - + + - {jobs.map((job) => ( - - - - + + + + - - - + ))} @@ -177,85 +274,58 @@ export default function AdminDashboard() { )} - {/* Applications Management Tab */} - {activeTab === "applications" && ( -
-

Application Management

-
-
Job TitleTitle CompanyLocation Status ApplicationsPosted Actions
{job.title}{job.company} - - {job.status} +
{job.title}{job.company}{job.location} + + {job.status.charAt(0).toUpperCase() + job.status.slice(1)} {job.applications}{job.posted} - - + {job.applications} + +
- - - - - - - - - - - {applications.map((app) => ( - - - - - - - - ))} - -
CandidatePositionStatusApplied DateActions
{app.candidate}{app.position} - - {app.status} - - {app.appliedDate} - - -
-
-
- )} - - {/* User Management Tab */} + {/* Users Tab */} {activeTab === "users" && ( -
-

User Management

-
+
+
+

User Management

+ +
+
- + - + {users.map((user) => ( - - - - - - + + + + + - ))} @@ -264,71 +334,16 @@ export default function AdminDashboard() { )} - - {/* Analytics Tab */} - {activeTab === "analytics" && ( -
-

Analytics Overview

-
-
-
-
-

Total Jobs

-

{analytics.totalJobs}

-
- -
-
-
-
-
-

Active Applications

-

{analytics.activeApplications}

-
- -
-
-
-
-
-

Total Users

-

{analytics.totalUsers}

-
- -
-
-
-
-
-

Avg Time to Hire

-

{analytics.avgTimeToHire}

-
- -
-
-
-
-
-

Monthly Growth

-

{analytics.monthlyGrowth}

-
- -
-
-
-
-
-

Conversion Rate

-

{analytics.conversionRate}

-
- -
-
-
-
- )} + + ); }
Name Email RoleJoinedJoin Date Status Actions
{user.name}{user.email}{user.role}{user.joined} - - {user.status} +
{user.name}{user.email} + {user.role.replace("_", " ")} + {user.joinDate} + + {user.status.charAt(0).toUpperCase() + user.status.slice(1)} - - + + +