diff --git a/src/App.jsx b/src/App.jsx index bdb167c04..3f50ccc83 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -13,6 +13,7 @@ import PlacementCellPage from "./Modules/PlacementCell"; import JobApplicationForm from "./Modules/PlacementCell/ApplyForPlacementForm"; import AddPlacementRecordForm from "./Modules/PlacementCell/components/AddPlacementRecordForm"; import AddPlacementEventForm from "./Modules/PlacementCell/components/AddPlacementEventForm"; +import PlacementEventHandeling from "./Modules/PlacementCell/components/PlacementEventHandeling"; export default function App() { const location = useLocation(); @@ -59,6 +60,14 @@ export default function App() { } + /> + + + + } /> state.user.role); + + // Sample data for job applications + const [applications, setApplications] = useState([ + { + id: 1, + name: "John Doe", + rollno: "CS202401", + email: "student1@example.com", + cpi: 8.5, + batch: "2024", + branch: "CSE", // Computer Science + status: "pending", + }, + { + id: 2, + name: "Jane Smith", + rollno: "ME202402", + email: "student2@example.com", + cpi: 7.9, + batch: "2024", + branch: "ME", // Mechanical Engineering + status: "pending", + }, + { + id: 3, + name: "Alice Johnson", + rollno: "EE202303", + email: "student3@example.com", + cpi: 9.1, + batch: "2023", + branch: "EE", // Electrical Engineering + status: "pending", + }, + { + id: 4, + name: "Bob Brown", + rollno: "CE202504", + email: "student4@example.com", + cpi: 8.0, + batch: "2025", + branch: "CE", // Civil Engineering + status: "pending", + }, + { + id: 5, + name: "Emily Davis", + rollno: "EC202305", + email: "student5@example.com", + cpi: 8.8, + batch: "2023", + branch: "EC", // Electronics + status: "pending", + }, + ]); + + const [loading, setLoading] = useState(false); + const [error, setError] = useState(null); + const [activePage, setActivePage] = useState(1); + const recordsPerPage = 10; + + const paginatedApplications = applications.slice( + (activePage - 1) * recordsPerPage, + activePage * recordsPerPage + ); + + const handleStatusChange = (applicationId, status) => { + console.log(`Application ${applicationId} updated to: ${status}`); + // Update the status in the local state + setApplications((prevApplications) => + prevApplications.map((application) => + application.id === applicationId ? { ...application, status } : application + ) + ); + }; + + if (loading) return ; + if (error) return {error}; + + return ( + + + {/* add job name to title */} + Student Job Applications +
+ +
+ + + + + + + + + + + {/* */} + + + + {paginatedApplications.map((application) => ( + + + + + + + + + + + ))} + +
NameRoll NoEmailCPIBatchBranchStatusAction
{application.name}{application.rollno}{application.email}{application.cpi}{application.batch}{application.branch} + + {/* */} +
+ +
+
+ ); +} + +export default JobApplicationsTable; diff --git a/src/Modules/PlacementCell/components/CreateNextRoundForm.jsx b/src/Modules/PlacementCell/components/CreateNextRoundForm.jsx new file mode 100644 index 000000000..41e86a040 --- /dev/null +++ b/src/Modules/PlacementCell/components/CreateNextRoundForm.jsx @@ -0,0 +1,101 @@ +import React, { useState } from "react"; +import { Modal, Button, TextInput, Select, Textarea, Card, Container } from "@mantine/core"; + +function CreateNextRoundForm() { + const [modalOpened, setModalOpened] = useState(false); + const [roundName, setRoundName] = useState(""); + const [date, setDate] = useState(""); + const [time, setTime] = useState(""); + const [location, setLocation] = useState(""); + const [description, setDescription] = useState(""); + const [roundType, setRoundType] = useState(""); + + const handleSubmit = () => { + const nextRoundDetails = { + roundName, + date, + time, + location, + description, + roundType, + }; + + console.log("Next Round Details:", nextRoundDetails); + setModalOpened(false); + // Reset form fields + setRoundName(""); + setDate(""); + setTime(""); + setLocation(""); + setDescription(""); + setRoundType(""); + }; + + return ( + + + setModalOpened(false)} + title="Add Next Round Details" + > + +
{ e.preventDefault(); handleSubmit(); }}> + setRoundName(e.target.value)} + required + /> + setDate(e.target.value)} + required + /> + setTime(e.target.value)} + required + /> + setLocation(e.target.value)} + required + /> +