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 + + + + + + + Name + Roll No + Email + CPI + Batch + Branch + Status + {/* Action */} + + + + {paginatedApplications.map((application) => ( + + {application.name} + {application.rollno} + {application.email} + {application.cpi} + {application.batch} + {application.branch} + + handleStatusChange(application.id, value)} + /> + + + {/* console.log('Add next round details')}> + Add Next Round + */} + + + ))} + + + + + + ); +} + +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(true)}>Create Next Round + 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 + /> + setDescription(e.target.value)} + /> + + + Save Round Details + + + + + + ); +} + +export default CreateNextRoundForm; diff --git a/src/Modules/PlacementCell/components/PlacementEventHandeling.jsx b/src/Modules/PlacementCell/components/PlacementEventHandeling.jsx new file mode 100644 index 000000000..746a8dade --- /dev/null +++ b/src/Modules/PlacementCell/components/PlacementEventHandeling.jsx @@ -0,0 +1,25 @@ +// combine the table, also add the create next round form +import React from 'react'; +import JobApplicationsTable from './AppliedStudentDetails'; +import CreateNextRoundForm from './CreateNextRoundForm'; + +function PlacementEventHandeling() { + + return ( + + + + + ); +} + +export default PlacementEventHandeling; + + diff --git a/src/Modules/PlacementCell/components/PlacementScheduleCard.jsx b/src/Modules/PlacementCell/components/PlacementScheduleCard.jsx index f8fe8968d..be358db51 100644 --- a/src/Modules/PlacementCell/components/PlacementScheduleCard.jsx +++ b/src/Modules/PlacementCell/components/PlacementScheduleCard.jsx @@ -1,7 +1,7 @@ import React, { useState } from "react"; import { Card, Text, Badge, Group, Button, Image, ActionIcon } from "@mantine/core"; -import { Clock, MapPin, Trash, Pencil } from "@phosphor-icons/react"; +import { Clock, MapPin, Trash, Pencil, Eye } from "@phosphor-icons/react"; import { useNavigate } from "react-router-dom"; import { useSelector } from 'react-redux'; @@ -28,6 +28,12 @@ function PlacementScheduleCard({ ); }; + const handelViewClick = () => { + navigate( + `/placement-cell/view?companyName=${encodeURIComponent(companyName)}&companyLogo=${encodeURIComponent(companyLogo)}`, + ); + }; + const handleDeleteClick = () => { setVisible(false); }; @@ -120,6 +126,11 @@ function PlacementScheduleCard({ + + + + + diff --git a/src/Modules/PlacementCell/index.jsx b/src/Modules/PlacementCell/index.jsx index 9aa35e594..7e4a68ec8 100644 --- a/src/Modules/PlacementCell/index.jsx +++ b/src/Modules/PlacementCell/index.jsx @@ -53,9 +53,7 @@ function PlacementCellPage() { {tabs.map((tab) => ( - {tab.component || No content available.} - ))}