diff --git a/src/app/company/dashboard/page.tsx b/src/app/company/dashboard/page.tsx
new file mode 100644
index 0000000..01ca02f
--- /dev/null
+++ b/src/app/company/dashboard/page.tsx
@@ -0,0 +1,6 @@
+import React from "react";
+import CompanyDashboard from "@/components/company/Dashboard";
+
+export default function CompanyDashboardPage() {
+ return ;
+}
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 02c5980..3e4caf7 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,7 +1,9 @@
+import CompanyDashboard from "@/components/company/Dashboard";
export default function Page() {
return (
-
+
+
);
}
diff --git a/src/components/company/CandidateResults.tsx b/src/components/company/CandidateResults.tsx
new file mode 100644
index 0000000..cd37668
--- /dev/null
+++ b/src/components/company/CandidateResults.tsx
@@ -0,0 +1,355 @@
+import React, { useState } from "react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from "@/components/ui/table";
+import { Badge } from "@/components/ui/badge";
+import {
+ Search,
+ Filter,
+ MoreHorizontal,
+ FileText,
+ Mail,
+ CheckCircle,
+ Clock,
+ AlertCircle,
+ ThumbsUp,
+ ThumbsDown,
+ HelpCircle,
+} from "lucide-react";
+
+interface Candidate {
+ id: string;
+ name: string;
+ email: string;
+ testTitle: string;
+ score: number;
+ submittedAt: string;
+ status: "Completed" | "In Progress" | "Failed";
+ suitability: "Suitable" | "Pending" | "Not Suitable";
+}
+
+const CandidateResults = () => {
+ const [searchQuery, setSearchQuery] = useState("");
+ const [statusFilter, setStatusFilter] = useState
(null);
+ const [suitabilityFilter, setSuitabilityFilter] = useState(
+ null,
+ );
+
+ // Mock candidate data
+ const candidates: Candidate[] = [
+ {
+ id: "1",
+ name: "Kim Min-ji",
+ email: "minji.kim@example.com",
+ testTitle: "JavaScript Fundamentals",
+ score: 92,
+ submittedAt: "2023-11-25 14:30",
+ status: "Completed",
+ suitability: "Suitable",
+ },
+ {
+ id: "2",
+ name: "Park Ji-hoon",
+ email: "jihoon.park@example.com",
+ testTitle: "React Component Architecture",
+ score: 78,
+ submittedAt: "2023-11-24 10:15",
+ status: "Completed",
+ suitability: "Suitable",
+ },
+ {
+ id: "3",
+ name: "Lee Soo-jin",
+ email: "soojin.lee@example.com",
+ testTitle: "Advanced Algorithms",
+ score: 0,
+ submittedAt: "2023-11-26 09:45",
+ status: "In Progress",
+ suitability: "Pending",
+ },
+ {
+ id: "4",
+ name: "Choi Tae-woo",
+ email: "taewoo.choi@example.com",
+ testTitle: "JavaScript Fundamentals",
+ score: 65,
+ submittedAt: "2023-11-23 16:20",
+ status: "Failed",
+ suitability: "Not Suitable",
+ },
+ {
+ id: "5",
+ name: "Kang Hye-jin",
+ email: "hyejin.kang@example.com",
+ testTitle: "Database Design",
+ score: 88,
+ submittedAt: "2023-12-01 11:30",
+ status: "Completed",
+ suitability: "Suitable",
+ },
+ {
+ id: "6",
+ name: "Yoon Jae-hyun",
+ email: "jaehyun.yoon@example.com",
+ testTitle: "API Development with Node.js",
+ score: 72,
+ submittedAt: "2023-12-02 13:45",
+ status: "Completed",
+ suitability: "Pending",
+ },
+ ];
+
+ // Filter candidates based on search query and filters
+ const filteredCandidates = candidates.filter((candidate) => {
+ const matchesSearch =
+ candidate.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
+ candidate.email.toLowerCase().includes(searchQuery.toLowerCase()) ||
+ candidate.testTitle.toLowerCase().includes(searchQuery.toLowerCase());
+
+ const matchesStatus = !statusFilter || candidate.status === statusFilter;
+ const matchesSuitability =
+ !suitabilityFilter || candidate.suitability === suitabilityFilter;
+
+ return matchesSearch && matchesStatus && matchesSuitability;
+ });
+
+ const getStatusIcon = (status: string) => {
+ switch (status) {
+ case "Completed":
+ return ;
+ case "In Progress":
+ return ;
+ case "Failed":
+ return ;
+ default:
+ return null;
+ }
+ };
+
+ const getStatusColor = (status: string) => {
+ switch (status) {
+ case "Completed":
+ return "bg-green-100 text-green-800";
+ case "In Progress":
+ return "bg-blue-100 text-blue-800";
+ case "Failed":
+ return "bg-red-100 text-red-800";
+ default:
+ return "";
+ }
+ };
+
+ const getSuitabilityIcon = (suitability: string) => {
+ switch (suitability) {
+ case "Suitable":
+ return ;
+ case "Not Suitable":
+ return ;
+ case "Pending":
+ return ;
+ default:
+ return null;
+ }
+ };
+
+ const getSuitabilityColor = (suitability: string) => {
+ switch (suitability) {
+ case "Suitable":
+ return "bg-green-100 text-green-800";
+ case "Not Suitable":
+ return "bg-red-100 text-red-800";
+ case "Pending":
+ return "bg-amber-100 text-amber-800";
+ default:
+ return "";
+ }
+ };
+
+ return (
+
+
+
Candidate Results
+
+
+
+
+ Candidate Evaluations
+
+ Review test results and candidate performance
+
+
+
+
+
+
+
+ setSearchQuery(e.target.value)}
+ />
+
+
+
+
+
+
+ setStatusFilter(null)}>
+ All Statuses
+
+ setStatusFilter("Completed")}>
+ Completed
+
+ setStatusFilter("In Progress")}
+ >
+ In Progress
+
+ setStatusFilter("Failed")}>
+ Failed
+
+
+
+
+
+
+
+
+ setSuitabilityFilter(null)}>
+ All Suitability
+
+ setSuitabilityFilter("Suitable")}
+ >
+ Suitable
+
+ setSuitabilityFilter("Pending")}
+ >
+ Pending
+
+ setSuitabilityFilter("Not Suitable")}
+ >
+ Not Suitable
+
+
+
+
+
+
+
+
+
+ Candidate
+ Test
+ Score
+ Submitted
+ Status
+ Suitability
+ Actions
+
+
+
+ {filteredCandidates.map((candidate) => (
+
+
+
+
{candidate.name}
+
+ {candidate.email}
+
+
+
+ {candidate.testTitle}
+
+ {candidate.status === "In Progress"
+ ? "-"
+ : `${candidate.score}%`}
+
+ {candidate.submittedAt}
+
+
+ {getStatusIcon(candidate.status)}
+ {candidate.status}
+
+
+
+
+ {getSuitabilityIcon(candidate.suitability)}
+ {candidate.suitability}
+
+
+
+
+
+
+
+
+
+ View Report
+
+
+ Contact Candidate
+
+
+
+
+
+ ))}
+
+
+
+
+
+
+
+ Showing {filteredCandidates.length} of {candidates.length}{" "}
+ candidates
+
+
+
+
+
+ );
+};
+
+export default CandidateResults;
diff --git a/src/components/company/CompanyProfile.tsx b/src/components/company/CompanyProfile.tsx
new file mode 100644
index 0000000..05027bf
--- /dev/null
+++ b/src/components/company/CompanyProfile.tsx
@@ -0,0 +1,388 @@
+import React, { useState } from "react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Textarea } from "@/components/ui/textarea";
+import { Label } from "@/components/ui/label";
+import { Badge } from "@/components/ui/badge";
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import { Separator } from "@/components/ui/separator";
+import {
+ Building2,
+ Users,
+ Mail,
+ Globe,
+ MapPin,
+ Phone,
+ Github,
+ Trello,
+ Plus,
+ X,
+ Save,
+ Upload,
+} from "lucide-react";
+
+interface CompanyProfileProps {
+ companyData: {
+ name: string;
+ logo?: string;
+ industry: string;
+ employeeCount: number;
+ email: string;
+ techStack: string[];
+ githubConnected: boolean;
+ jiraConnected: boolean;
+ website?: string;
+ location?: string;
+ phone?: string;
+ description?: string;
+ };
+}
+
+const CompanyProfile = ({ companyData }: CompanyProfileProps) => {
+ const [editMode, setEditMode] = useState(false);
+ const [company, setCompany] = useState(companyData);
+ const [newTech, setNewTech] = useState("");
+
+ const handleAddTech = () => {
+ if (newTech.trim() && !company.techStack.includes(newTech.trim())) {
+ setCompany({
+ ...company,
+ techStack: [...company.techStack, newTech.trim()],
+ });
+ setNewTech("");
+ }
+ };
+
+ const handleRemoveTech = (tech: string) => {
+ setCompany({
+ ...company,
+ techStack: company.techStack.filter((t) => t !== tech),
+ });
+ };
+
+ const handleInputChange = (
+ e: React.ChangeEvent,
+ ) => {
+ const { name, value } = e.target;
+ setCompany({
+ ...company,
+ [name]: value,
+ });
+ };
+
+ const handleSave = () => {
+ // Here you would typically make an API call to save the data
+ console.log("Saving company profile:", company);
+ setEditMode(false);
+ };
+
+ return (
+
+
+
Company Profile
+ {!editMode ? (
+
+ ) : (
+
+
+
+
+ )}
+
+
+
+ {/* Company Basic Info */}
+
+
+ Company Information
+ Your company's basic information
+
+
+
+
+ {company.logo ? (
+
+ ) : (
+
+ {company.name.slice(0, 2).toUpperCase()}
+
+ )}
+
+ {editMode && (
+
+ )}
+
+
+
+
+
+
+ Company Name
+
+ {editMode ? (
+
+ ) : (
+
{company.name}
+ )}
+
+
+
+
+
+ Email
+
+ {editMode ? (
+
+ ) : (
+
{company.email}
+ )}
+
+
+
+
+
+ Industry
+
+ {editMode ? (
+
+ ) : (
+
{company.industry}
+ )}
+
+
+
+
+
+ Employee Count
+
+ {editMode ? (
+
+ ) : (
+
{company.employeeCount}
+ )}
+
+
+ {editMode && (
+ <>
+
+
+
+
+
+ >
+ )}
+
+ {!editMode && (
+ <>
+ {company.website && (
+
+
+
+ Website
+
+
{company.website}
+
+ )}
+
+ {company.location && (
+
+
+
+ Location
+
+
{company.location}
+
+ )}
+
+ {company.phone && (
+
+ )}
+ >
+ )}
+
+
+
+
+ {/* Company Details */}
+
+
+ Company Details
+
+ Additional information about your company
+
+
+
+
+
+
+ {editMode ? (
+
+ ) : (
+
+ {company.description || "No company description provided."}
+
+ )}
+
+
+
+
+
+
+
+
+ {company.techStack.map((tech) => (
+
+ {tech}
+ {editMode && (
+ handleRemoveTech(tech)}
+ />
+ )}
+
+ ))}
+
+ {editMode && (
+
+
setNewTech(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ e.preventDefault();
+ handleAddTech();
+ }
+ }}
+ />
+
+
+ )}
+
+
+
+
+
+
+
+
+
+
+
+ GitHub
+
+
+
+
+
+
+
+ Jira
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default CompanyProfile;
diff --git a/src/components/company/Dashboard.tsx b/src/components/company/Dashboard.tsx
new file mode 100644
index 0000000..7081fff
--- /dev/null
+++ b/src/components/company/Dashboard.tsx
@@ -0,0 +1,65 @@
+"use client";
+
+import React, { useState } from "react";
+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
+import CompanySidebar from "./Sidebar";
+import DashboardOverview from "./DashboardOverview";
+import TestManagement from "./TestManagement";
+import CandidateResults from "./CandidateResults";
+import CompanyProfile from "./CompanyProfile";
+
+const CompanyDashboard = () => {
+ const [activeTab, setActiveTab] = useState("overview");
+
+ // Mock company data
+ const companyData = {
+ name: "Tech Solutions Inc.",
+ logo: "",
+ industry: "Software Development",
+ employeeCount: 120,
+ email: "admin@techsolutions.com",
+ techStack: ["React", "Node.js", "Python", "AWS", "MongoDB"],
+ githubConnected: false,
+ jiraConnected: false,
+ };
+
+ return (
+
+
+
+
+
+
Company Dashboard
+
+ Overview
+ Tests
+ Candidates
+ Company Profile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default CompanyDashboard;
diff --git a/src/components/company/DashboardOverview.tsx b/src/components/company/DashboardOverview.tsx
new file mode 100644
index 0000000..bb6b6ae
--- /dev/null
+++ b/src/components/company/DashboardOverview.tsx
@@ -0,0 +1,170 @@
+"use client";
+
+import React from "react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card";
+import {
+ FileCode,
+ Users,
+ BarChart,
+ CheckCircle,
+ Clock,
+ Calendar,
+} from "lucide-react";
+import { Button } from "@/components/ui/button";
+import { TestScoreChart } from "./charts/TestScoreChart";
+import { TestStatusChart } from "./charts/TestStatusChart";
+import RecentActivityList from "./RecentActivityList";
+
+const DashboardOverview = () => {
+ // Mock data for dashboard stats
+ const stats = {
+ totalTests: 12,
+ activeTests: 5,
+ totalCandidates: 68,
+ passRate: 72,
+ averageScore: 76,
+ pendingReviews: 8,
+ };
+
+ return (
+
+ {/* Stats Cards */}
+
+
+
+ Total Tests
+
+
+
+ {stats.totalTests}
+
+ {stats.activeTests} currently active
+
+
+
+
+
+
+
+ Total Candidates
+
+
+
+
+ {stats.totalCandidates}
+ +14 from last month
+
+
+
+
+
+ Pass Rate
+
+
+
+ {stats.passRate}%
+
+ +5% from previous tests
+
+
+
+
+
+
+ Average Score
+
+
+
+ {stats.averageScore}/100
+
+ Based on all completed tests
+
+
+
+
+
+
+
+ Pending Reviews
+
+
+
+
+ {stats.pendingReviews}
+
+ Candidates awaiting review
+
+
+
+
+
+
+
+ Next Scheduled Test
+
+
+
+
+ Frontend Developer
+ Tomorrow, 10:00 AM
+
+
+
+
+ {/* Charts and Activity */}
+
+
+
+ Test Score Distribution
+
+ Score distribution across all candidates
+
+
+
+
+
+
+
+
+
+
+
+ Test Status
+
+ Overview of test completion status
+
+
+
+
+
+
+
+
+
+
+ {/* Recent Activity */}
+
+
+
+ Recent Activity
+ Latest actions and updates
+
+
+
+
+
+
+
+
+ );
+};
+
+export default DashboardOverview;
diff --git a/src/components/company/RecentActivityList.tsx b/src/components/company/RecentActivityList.tsx
new file mode 100644
index 0000000..4cabd33
--- /dev/null
+++ b/src/components/company/RecentActivityList.tsx
@@ -0,0 +1,183 @@
+"use client";
+
+import React from "react";
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import { Badge } from "@/components/ui/badge";
+import {
+ FileCode,
+ Users,
+ CheckCircle,
+ Clock,
+ AlertCircle,
+ Settings,
+} from "lucide-react";
+
+interface ActivityItem {
+ id: string;
+ type:
+ | "test_created"
+ | "candidate_completed"
+ | "candidate_started"
+ | "test_updated"
+ | "settings_changed";
+ title: string;
+ description: string;
+ timestamp: string;
+ user?: {
+ name: string;
+ avatar?: string;
+ };
+}
+
+const RecentActivityList = () => {
+ // Mock activity data
+ const activities: ActivityItem[] = [
+ {
+ id: "1",
+ type: "candidate_completed",
+ title: "Candidate Completed Test",
+ description:
+ "Kim Min-ji completed JavaScript Fundamentals test with a score of 92%",
+ timestamp: "2 hours ago",
+ user: {
+ name: "Kim Min-ji",
+ avatar: "https://api.dicebear.com/7.x/avataaars/svg?seed=Kim",
+ },
+ },
+ {
+ id: "2",
+ type: "test_created",
+ title: "New Test Created",
+ description: "System Design Interview test was created",
+ timestamp: "Yesterday",
+ user: {
+ name: "Admin User",
+ avatar: "https://api.dicebear.com/7.x/avataaars/svg?seed=Admin",
+ },
+ },
+ {
+ id: "3",
+ type: "candidate_started",
+ title: "Candidate Started Test",
+ description: "Lee Soo-jin started Advanced Algorithms test",
+ timestamp: "2 days ago",
+ user: {
+ name: "Lee Soo-jin",
+ avatar: "https://api.dicebear.com/7.x/avataaars/svg?seed=Lee",
+ },
+ },
+ {
+ id: "4",
+ type: "test_updated",
+ title: "Test Updated",
+ description: "React Component Architecture test was updated",
+ timestamp: "3 days ago",
+ user: {
+ name: "Admin User",
+ avatar: "https://api.dicebear.com/7.x/avataaars/svg?seed=Admin",
+ },
+ },
+ {
+ id: "5",
+ type: "settings_changed",
+ title: "Settings Changed",
+ description: "Company profile information was updated",
+ timestamp: "1 week ago",
+ user: {
+ name: "Admin User",
+ avatar: "https://api.dicebear.com/7.x/avataaars/svg?seed=Admin",
+ },
+ },
+ ];
+
+ const getActivityIcon = (type: string) => {
+ switch (type) {
+ case "test_created":
+ case "test_updated":
+ return ;
+ case "candidate_completed":
+ return ;
+ case "candidate_started":
+ return ;
+ case "settings_changed":
+ return ;
+ default:
+ return ;
+ }
+ };
+
+ const getActivityBadge = (type: string) => {
+ switch (type) {
+ case "test_created":
+ return (
+
+ Test Created
+
+ );
+ case "test_updated":
+ return (
+
+ Test Updated
+
+ );
+ case "candidate_completed":
+ return (
+
+ Completed
+
+ );
+ case "candidate_started":
+ return (
+
+ Started
+
+ );
+ case "settings_changed":
+ return (
+
+ Settings
+
+ );
+ default:
+ return null;
+ }
+ };
+
+ return (
+
+ {activities.map((activity) => (
+
+
+ {getActivityIcon(activity.type)}
+
+
+
+
{activity.title}
+ {getActivityBadge(activity.type)}
+
+
+ {activity.description}
+
+
+ {activity.user && (
+
+
+
+
+ {activity.user.name.slice(0, 2).toUpperCase()}
+
+
+
{activity.user.name}
+
+ )}
+
•
+
{activity.timestamp}
+
+
+
+ ))}
+
+ );
+};
+
+export default RecentActivityList;
diff --git a/src/components/company/Sidebar.tsx b/src/components/company/Sidebar.tsx
new file mode 100644
index 0000000..205d94e
--- /dev/null
+++ b/src/components/company/Sidebar.tsx
@@ -0,0 +1,144 @@
+"use client";
+
+import React from "react";
+import Link from "next/link";
+import { usePathname } from "next/navigation";
+import { cn } from "@/lib/utils";
+import { Button } from "@/components/ui/button";
+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import {
+ LayoutDashboard,
+ FileCode,
+ Users,
+ FileBarChart,
+ Settings,
+ LogOut,
+ Plus,
+ Building2,
+} from "lucide-react";
+
+interface CompanySidebarProps {
+ companyName?: string;
+ companyEmail?: string;
+ companyLogo?: string;
+}
+
+const CompanySidebar = ({
+ companyName = "Tech Solutions Inc.",
+ companyEmail = "admin@techsolutions.com",
+ companyLogo = "",
+}: CompanySidebarProps) => {
+ const pathname = usePathname();
+
+ const navItems = [
+ {
+ name: "Dashboard",
+ href: "/company/dashboard",
+ icon: ,
+ },
+ {
+ name: "Tests",
+ href: "/company/tests",
+ icon: ,
+ },
+ {
+ name: "Candidates",
+ href: "/company/candidates",
+ icon: ,
+ },
+ {
+ name: "Reports",
+ href: "/company/reports",
+ icon: ,
+ },
+ {
+ name: "Settings",
+ href: "/company/settings",
+ icon: ,
+ },
+ ];
+
+ return (
+
+ {/* Company Logo and Name */}
+
+
+
+
+
+
{companyName}
+
Company Dashboard
+
+
+
+ {/* Navigation */}
+
+
+ {navItems.map((item) => (
+
+
+
+ ))}
+
+
+ {/* Create New Test Button */}
+
+
+
+
+
+ {/* Company Profile */}
+
+
+
+ {companyLogo ? (
+
+ ) : (
+
+ {companyName.slice(0, 2).toUpperCase()}
+
+ )}
+
+
+
{companyName}
+
+ {companyEmail}
+
+
+
+
+
+
+
+
+ Log out
+
+
+
+
+
+
+ );
+};
+
+export default CompanySidebar;
diff --git a/src/components/company/TestManagement.tsx b/src/components/company/TestManagement.tsx
new file mode 100644
index 0000000..f986682
--- /dev/null
+++ b/src/components/company/TestManagement.tsx
@@ -0,0 +1,298 @@
+import React, { useState } from "react";
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from "@/components/ui/table";
+import { Badge } from "@/components/ui/badge";
+import {
+ Plus,
+ Search,
+ Filter,
+ MoreHorizontal,
+ Copy,
+ Pencil,
+ Trash2,
+ Share2,
+ Eye,
+} from "lucide-react";
+
+interface Test {
+ id: string;
+ title: string;
+ difficulty: "Easy" | "Medium" | "Hard";
+ type: string;
+ submissions: number;
+ passRate: number;
+ createdAt: string;
+ status: "Active" | "Draft" | "Completed" | "Archived";
+}
+
+const TestManagement = () => {
+ const [searchQuery, setSearchQuery] = useState("");
+ const [selectedFilter, setSelectedFilter] = useState(null);
+
+ // Mock test data
+ const tests: Test[] = [
+ {
+ id: "1",
+ title: "JavaScript Fundamentals",
+ difficulty: "Easy",
+ type: "Frontend",
+ submissions: 24,
+ passRate: 78,
+ createdAt: "2023-10-15",
+ status: "Active",
+ },
+ {
+ id: "2",
+ title: "React Component Architecture",
+ difficulty: "Medium",
+ type: "Frontend",
+ submissions: 18,
+ passRate: 62,
+ createdAt: "2023-11-02",
+ status: "Active",
+ },
+ {
+ id: "3",
+ title: "Advanced Algorithms",
+ difficulty: "Hard",
+ type: "Algorithm",
+ submissions: 12,
+ passRate: 45,
+ createdAt: "2023-11-20",
+ status: "Active",
+ },
+ {
+ id: "4",
+ title: "Database Design",
+ difficulty: "Medium",
+ type: "Backend",
+ submissions: 15,
+ passRate: 70,
+ createdAt: "2023-12-05",
+ status: "Active",
+ },
+ {
+ id: "5",
+ title: "API Development with Node.js",
+ difficulty: "Medium",
+ type: "Backend",
+ submissions: 20,
+ passRate: 65,
+ createdAt: "2024-01-10",
+ status: "Active",
+ },
+ {
+ id: "6",
+ title: "System Design Interview",
+ difficulty: "Hard",
+ type: "System Design",
+ submissions: 8,
+ passRate: 50,
+ createdAt: "2024-02-15",
+ status: "Draft",
+ },
+ ];
+
+ // Filter tests based on search query and selected filter
+ const filteredTests = tests.filter((test) => {
+ const matchesSearch = test.title
+ .toLowerCase()
+ .includes(searchQuery.toLowerCase());
+ const matchesFilter = !selectedFilter || test.type === selectedFilter;
+ return matchesSearch && matchesFilter;
+ });
+
+ // Get unique test types for filter
+ const testTypes = Array.from(new Set(tests.map((test) => test.type)));
+
+ const getDifficultyColor = (difficulty: string) => {
+ switch (difficulty) {
+ case "Easy":
+ return "bg-green-100 text-green-800";
+ case "Medium":
+ return "bg-yellow-100 text-yellow-800";
+ case "Hard":
+ return "bg-red-100 text-red-800";
+ default:
+ return "";
+ }
+ };
+
+ const getStatusColor = (status: string) => {
+ switch (status) {
+ case "Active":
+ return "bg-blue-100 text-blue-800";
+ case "Draft":
+ return "bg-gray-100 text-gray-800";
+ case "Completed":
+ return "bg-green-100 text-green-800";
+ case "Archived":
+ return "bg-purple-100 text-purple-800";
+ default:
+ return "";
+ }
+ };
+
+ return (
+
+
+
Test Management
+
+
+
+
+
+ Your Tests
+
+ Manage your coding tests and assessments
+
+
+
+
+
+
+
+ setSearchQuery(e.target.value)}
+ />
+
+
+
+
+
+
+ setSelectedFilter(null)}>
+ All Types
+
+ {testTypes.map((type) => (
+ setSelectedFilter(type)}
+ >
+ {type}
+
+ ))}
+
+
+
+
+
+
+
+
+ Title
+ Type
+ Difficulty
+ Submissions
+ Pass Rate
+ Status
+ Created
+ Actions
+
+
+
+ {filteredTests.map((test) => (
+
+ {test.title}
+ {test.type}
+
+
+ {test.difficulty}
+
+
+
+ {test.submissions}
+
+
+ {test.passRate}%
+
+
+
+ {test.status}
+
+
+ {test.createdAt}
+
+
+
+
+
+
+
+ View
+
+
+ Edit
+
+
+ Duplicate
+
+
+ Share
+
+
+ Delete
+
+
+
+
+
+ ))}
+
+
+
+
+
+
+
+ Showing {filteredTests.length} of {tests.length} tests
+
+
+
+
+
+ );
+};
+
+export default TestManagement;
diff --git a/src/components/company/charts/TestScoreChart.tsx b/src/components/company/charts/TestScoreChart.tsx
new file mode 100644
index 0000000..b1ef4fd
--- /dev/null
+++ b/src/components/company/charts/TestScoreChart.tsx
@@ -0,0 +1,52 @@
+"use client";
+
+import React from "react";
+import {
+ BarChart,
+ Bar,
+ XAxis,
+ YAxis,
+ CartesianGrid,
+ Tooltip,
+ ResponsiveContainer,
+ Legend,
+} from "recharts";
+
+export const TestScoreChart = () => {
+ // Mock data for score distribution
+ const data = [
+ { range: "0-20", count: 2, fill: "hsl(var(--chart-1))" },
+ { range: "21-40", count: 5, fill: "hsl(var(--chart-2))" },
+ { range: "41-60", count: 12, fill: "hsl(var(--chart-3))" },
+ { range: "61-80", count: 28, fill: "hsl(var(--chart-4))" },
+ { range: "81-100", count: 21, fill: "hsl(var(--chart-5))" },
+ ];
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ );
+};
diff --git a/src/components/company/charts/TestStatusChart.tsx b/src/components/company/charts/TestStatusChart.tsx
new file mode 100644
index 0000000..af30fc4
--- /dev/null
+++ b/src/components/company/charts/TestStatusChart.tsx
@@ -0,0 +1,52 @@
+"use client";
+
+import React from "react";
+import {
+ PieChart,
+ Pie,
+ Cell,
+ ResponsiveContainer,
+ Legend,
+ Tooltip,
+} from "recharts";
+
+export const TestStatusChart = () => {
+ // Mock data for test status
+ const data = [
+ { name: "Completed", value: 42, fill: "hsl(var(--chart-1))" },
+ { name: "In Progress", value: 15, fill: "hsl(var(--chart-2))" },
+ { name: "Not Started", value: 11, fill: "hsl(var(--chart-3))" },
+ ];
+
+ return (
+
+
+
+ `${name}: ${(percent * 100).toFixed(0)}%`
+ }
+ labelLine={false}
+ >
+ {data.map((entry, index) => (
+ |
+ ))}
+
+
+
+
+
+ );
+};
diff --git a/src/components/dashboard/Sidebar.tsx b/src/components/dashboard/Sidebar.tsx
index f998207..c44022d 100644
--- a/src/components/dashboard/Sidebar.tsx
+++ b/src/components/dashboard/Sidebar.tsx
@@ -1,3 +1,5 @@
+"use client";
+
import React from "react";
import Link from "next/link";
import { usePathname } from "next/navigation";